This repo contains instructions for creating a Docker image or running a pre-existing Docker image that can support the usage of SUMMA and pySUMMA simulations.
Ubuntu
- Install Docker with
sudo apt install docker.io
in the terminal. - Git clone or copy the files in this repository into a folder.
Dockerfile
- A text file used by Docker that lists all the commands used to build an image. This includes commands such as those that install packages and add local files to the image. More info here.environment.yml
- A text file used by Conda that lists all of packages to be installed and creates a virtual environment. It specifies the environment name and the channels to install the packages from. More info here.
- In the terminal, change directories into the folder containing the files.
- Create the Docker image with:
docker build .
The command will step through the Dockerfile and output the results of each line. - When the build completes. Using the
docker images
command will list all the images. (optional) The created Docker image will have no name associated with it. Usedocker tag containerID yourContainerName
to rename it. - Run the image with:
docker run -it -p=8888:8888 [containerNameOrID]
This will create a container which is based off the image. It will create a bash terminal inside the container. Exit the container using the command:exit
- the -it flag creates a terminal instance inside of the container.
- the -p flag publishes the container's port 8888 to the host's port 8888. If something is already running on port 8888 localhost, then the number needs to be changed.
- the -v flag mounts the specified directories into the container so that it has access to the host's docker daemon
- (optional) the --rm flag deletes the container after exiting, otherwise, it will keep running in the background.
- After entering the terminal, a jupyter notebook server can be launched with the following command:
jupyter notebook --ip=0.0.0.0 --allow-root
- An image can be found here on DockerHub. Pull the image to your machine using:
docker pull davidchoi76/summa3:tagname
- After the image finishs downloading, follow step 4 and on from the instructions above.
In the event you already have a notebook or other files you want to include.
- If creating a Docker image
- Just add the desired files to the directory with the Dockerfile before running
docker build .
- Just add the desired files to the directory with the Dockerfile before running
- If running a pre-existing image
- Run
docker cp path/to/file containerID:path/to/file
after running the image
- Run
- List all running containers with
docker ps -a
. - Delete running containers with
docker container rm ContainerID
- List all Docker images with 'docker images'
- Delete a Docker image with 'docker image rm image_id'