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 home directory of user "smoguser" 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 is located in /opt/smog2 and smog-check in /opt/smog-check.

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.

There is another approach to mounting external folders that one may want to use (though note the warning):

>$ docker run -it --rm -v $HOME:/home/smoguser smogserver/smog2:stable

$HOME refers to your home directory and it is typically already a shell variable. /home/smoguser is the home directory of the default user in the container. When inside the container, it should thus effectively start you in your home directory with a bash prompt. Note that in this case, even though the directory is named /home/smoguser, it is in fact your actual home directory. So, editing and deleting files will changw the files in your home directory! WARNING: Although this seems like a nice approach, we have noticed that the Docker manager doesn't like to have such a large portion of the disk mounted, and can then run 100% of the processor. YMMV.

Please direct questions and comments to info@smog-server.org.
Page created and maintained by Jeff Noel and Paul Whitford