JETSCAPE School 2020 Docker Installation

Mac OS X Installation

Getting started in git and docker

Linux (apt-get debian: Ubuntu )

sudo apt-get install docker

Docker Command Practice

docker ps; docker ps -a

What is running; what is running and has run and exited

% docker run -it busybox

# hostname | tee test.txt

# exit

Run the busybox docker image interactively (-it) ; get the containerID (hostname) and put it to file test.txt; and exit

% docker cp containerID:/test.txt .

Copy the test.txt from the exited container (hostname) and put it in the current directory

% docker ps -a; docker rm containerID

Check exited list of containers and remove old container

% docker run -it –rm busybox

# exit

% docker ps -a

Use the (–rm) flag to remove containers automatically

% mkdir ~/test

% chmod 2777

% docker run -it –rm -v ~/test:/test-mapped busybox

# hostname | tee /test-mapped/docker-hostname.txt

# exit

% docker ps -a; ls ~/test

Make a directory on the host machine.  Temporary work around for some systems, set permissions to allow read/write for all systems (if there are issues, post on slack).  Run the docker image with the ~/test folder mounted in the docker as /test-mapped. Write the hostname to a file, which will persist in the host system.  After exit, container is removed and files written to mounted folder persist. 

Go to the docker setup instructions for docker at the JETSCAPE github page.