SMOG 2 in Docker

What is Docker?

As described at the Docker website, a container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. Docker is a specific form of container software. Generally, Docker is quite easy to use on a personal computer. However, if you are using a cluster, Singularity will likely be a more useful container strategy.

Using SMOG 2 with Docker

We provide containerized version of SMOG 2 through the SMOG 2 Docker Hub page. If docker is running on your computer, the following command will pull the container to your local machine:

>$ docker pull smogserver/smog2:stable

If you want to use a different version, then change the tag "stable" to the desired version (e.g. gitversion, v2.4.4, v2.4.5-pre1, etc). The above command will download the container in the form of a Singularity Image Format file: smog2_<tag>.sif

The container can then be launched with:

>$ docker run -it --rm smogserver/smog2:stable

You are initially placed into the directory /workdir inside the container at a bash prompt. Note that the container is essentially a stripped down version of Ubuntu Linux. vi and nano text editors are available. All smog2 executables are available in the $PATH. smog2, smog tools and smog-check may be found in /opt/smog2.

Description of flags
--rm : Automatically remove the container when it exits
-t : Give a shell-like experience (tty)
-i : Make the container interactive

IMPORTANT: You will want to connect the container to the files on your computer, e.g. to load PDB files and to write output files. This is done with the -v switch, which connects (mounts) a directory on your filesystem to a directory inside the container. This can be done however you like, but we typically use the following approach:

>$ docker run -it --rm -v $(pwd):/workdir smogserver/smog2:stable

In this case, the directory that the docker is called from ($pwd) i.e. present working directory, is mounted as /workdir in the container. As long as all the files you need are available in $pwd and its subdirectories, then they will be available to the container in /workdir and its subdirectories. The container will be unable to interact with any directories above $pwd. To belabor the point: any files edited or created in /workdir will appear or be edited on your actual disk in $pwd. Further, you must only mount to /workdir. This is an empty directory in the container, so you should be able to mount any external directory to it without issues (though larger directories can reduce the performance of the container).

This resource is provided by the Center for Theoretical Biological Physics.
Please direct questions and comments to info@smog-server.org.
Page created and maintained by Jeff Noel and Paul Whitford