# Docker

Docker (opens new window) provides application containers for Linux. You may run Docker on On-demand and BLUE machines.

Singularity on home machines

Docker will fail on your home machine due to security restrictions. We recommend that you run Singularity on your home machine. Read more in our Singularity installation guide.

# Installation

Follow the official Docker installation guide (opens new window) to install Docker on unmanaged machines (On-demand and BLUE machines). GPU machines come with nvidia-docker preinstalled.

# Move Docker directory

The operating system volume on your machine is limited in size. Depending on your size requirements, you may want to move your docker directory off the system disk and over to your machine home folder.

On you unamanged machine:

  1. Stop the docker service.
sudo service docker stop
  1. Copy your Docker files to your home folder.
sudo rsync -avu /var/lib/docker/ /home/docker
  1. Point Docker to your new location by editing /etc/docker/daemon.json and add your new data-root path:
sudo vim /etc/docker/daemon.json

Example for On-demand and BLUE machines:

{
    "data-root": "/home/docker",
}

Example for GPU machines:

{
    "data-root": "/home/docker",
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}
  1. Backup your original Docker files.
sudo mv /var/lib/docker /var/lib/docker.backup
  1. Restart the Docker service to fetch the new location.
sudo service docker restart
  1. Test your new setup with a Docker command.
docker ps -a

# Troubleshooting

# Issues with pip packages

We have seen issues with installation of pip packages due to mtu size issues. One solution is to add mtu size specification to your Docker config file:

  1. Open your Docker config file.
sudo vim /etc/docker/daemon.json
  1. Set mtu to 1330.

This is an example configuration setting mtu to 1330 to avoid most issues with packet sizes:

{
    "data-root": "/home/docker",
    "mtu": 1330
}
Last Updated: 5/27/2024