Computer Science Docker

Do not install Docker without reading this, even on a computer that you manage yourself.

 

This page is designed to tell you how to install Docker on Computer Science systems.

What is Docker?

Docker is a system for creating and using "containers." A container is somewhat like a virtual machine, except that it doesn't have its own kernel. There are two main uses:

Do you need Docker or should you use Singularity?

Docker images are often used to package software for AI and data analysis. If you find a docker image that has software you want to use, we suggest that you use the program singularity to run the docker image, especially, if you are doing Cuda and AI/Learning tools and need GPUs on CS machines. Singularity is easier to use than Docker, and gives you access to your normal files within the container. It can run most Docker images. See Basic Singularity Command and Utilization

Note: Currently, rootless docker will not run along with Slurm job scheduler on our system which is required if you need to use GPUs.

However if you are trying to create a new Docker image, rather than just run an existing one, you'll need the actual Docker software. You'll also need the actual Docker if you need to run a Docker image that has servers such as a web server in it.

If you can become root

This section is for people who run their own Linux systems. If you're using a system that we run, such as the ilab systems, please see the next section.

If you can do su or sudo, you can do a normal Docker installation. You can install it using apt (Ubuntu) or yum (Centos), or get the most recent release directy from the Docker web page. But there's one thing you must do first .

If you simply install Docker without doing anything else, your system may lose access to the network. To prevent this, before installing Docker create the file /etc/docker/daemon.json . It should contain the following:

{
  "bip": "192.168.100.2/24",
  "mtu": 1500
}
This will cause Docker to use a network that doesn't conflict with any of ours.

One other warning: Docker images and volumes must be on a local disk. Docker doesn't work with NFS, i.e. file systems mounted from file servers. On most systens, your home directory is on a file server. So make sure you put Docker files on /usr, /var, /freespace, etc.

If you can't become root -- i.e. you're a normal user

Until recently, Docker could only be used by people who could do su or sudo. However the most recent release can be used by normal users. Here is a page that describes that: Run the Docker daemon as a non-root user .

However there are some things you must do before you try this out on one of the systems we run. The example below shows all of these things.

Important Notes

We recommend using only one system for Docker, or at least one system per home directory. (E.g., in your home directory on /common/home or /freespace/local directory.