User Tools

Site Tools


software:pylith:docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:pylith:docker [2016/09/21 20:51]
baagaard [Run Unix shell within Docker to use PyLith.]
software:pylith:docker [2017/03/29 19:52] (current)
baagaard [Running PyLith in a portable, Linux environment via Docker]
Line 1: Line 1:
-====== What is Docker? ======+====== Running PyLith in a portable, Linux environment via Docker ====== 
 + 
 +**See the PyLith User Manual (v2.2.0) for the latest instructions.** The instructions here do not include how to use applications with graphical-user interfaces within the container. 
 + 
 +===== What is Docker? ===== 
  
 From https://​www.docker.com/​what-docker:​ From https://​www.docker.com/​what-docker:​
Line 9: Line 14:
 > Containers running on a single machine share the same operating system kernel; they start instantly and use less RAM. Images are constructed from layered filesystems and share common files, making disk usage and image downloads much more efficient."​ > Containers running on a single machine share the same operating system kernel; they start instantly and use less RAM. Images are constructed from layered filesystems and share common files, making disk usage and image downloads much more efficient."​
  
-====== Setup (first time only) ======+===== Setup (first time only) =====
  
-===== Install Docker ​=====+==== Install Docker ====
  
 https://​www.docker.com/​products/​docker https://​www.docker.com/​products/​docker
  
-===== Create container to store persistent user data =====+==== Create container to store persistent user data ====
  
-This container will hold a directory where all your user data can be stored for use with PyLith within Docker. This directory is not directly accessible from your host computer. However, you can copy files to/from your host filesystem using "​docker cp" (see below).+This container, called pylith-data,  ​will hold a directory where all your user data can be stored for use with PyLith within Docker. The data can persist for different versions of PyLith; that is, you can update to a newer version of PyLith and your user data will still be available. This directory is not directly accessible from your host computer. However, you can copy files to/from your host filesystem using "​docker cp" (see below).
  
 <​code>​ <​code>​
Line 24: Line 29:
  
  
-====== Run Unix shell within Docker to use PyLith. ​======+===== Run Unix shell within Docker to use PyLith. =====
  
 <​code>​ <​code>​
Line 30: Line 35:
 </​code>​ </​code>​
  
-**HINT**: ​You will probably want to copy the examples from the pylith-VERSION directory to the data directory, which is the persistent storage.+**HINT**: ​Within the container, you will probably want to copy the examples from the pylith-VERSION directory to the data directory, which is the persistent storage.
  
 <​code>​ <​code>​
Line 37: Line 42:
  
   * To "​pause"​ the container. ''​Control-p Control-q''​   * To "​pause"​ the container. ''​Control-p Control-q''​
-  * To attach to "​paused"​ or "​running"​ container. ​+  * To attach to "​paused"​ or "​running"​ container. ​
     - Get container id ''​$ docker ps''​     - Get container id ''​$ docker ps''​
     - Attach to container ''​$ docker attach CONTAINER_ID''​     - Attach to container ''​$ docker attach CONTAINER_ID''​
  
-====== Copy data to/from persistent storage volume. ======+==== Troubleshooting ==== 
 + 
 +<​code>​ 
 +docker: Error response from daemon: oci runtime error: process_linux.go:​330:​ running prestart hook 0 caused "​fork/​exec /​usr/​bin/​dockerd (deleted): no such file or directory: ". 
 +</​code>​ 
 + 
 +  * Restart docker. ​ ''​$ sudo service docker restart''​ 
 +  * Run docker image. ''​$ docker run -ti --volumes-from pylith-data geodynamics/​pylith''​ 
 + 
 +===== Copy data to/from persistent storage volume. ===== 
 + 
 +These commands are run on the local host outside the container, not inside the Docker container.
  
   * Copy data FROM persistent storage volume TO local host   * Copy data FROM persistent storage volume TO local host
-''​$ docker cp pylith-data:/​data/​pylith-user/​PATH/​FILENAME LOCAL_PATH''​+<​code>​ 
 +$ docker cp pylith-data:/​data/​pylith-user/​PATH/​FILENAME LOCAL_PATH 
 +</​code>​
   * Copy data FROM local host TO persistent storage volume   * Copy data FROM local host TO persistent storage volume
-''  ​$ docker cp LOCAL_PATH pylith-data:/​data/​pylith-user/​PATH/​''​+<​code>​ 
 +$ docker cp LOCAL_PATH pylith-data:/​data/​pylith-user/​PATH/​ 
 +</​code>​
  
-====== Docker Quick Reference ​======+===== Docker Quick Reference =====
  
   * List local docker images ''​$ docker images''​   * List local docker images ''​$ docker images''​
software/pylith/docker.1474491082.txt.gz · Last modified: 2016/09/21 20:51 by baagaard