📝 Note: If you are looking to eventually utilize Docker containers on an High Performance Computer (HPC), you may consider using Singularity instead, as it is designed to work in HPC systems.
Docker is a tool that can package an application and its dependencies in a virtual container that can run on any Linux server. This helps enable flexibility and portability on where the application can run, whether on premises, public cloud, private cloud, bare metal, etc.
Containers have somewhat similar goals to a virtual machine (VM). However, a Docker container is not a VM. You are probably aware that VM's have some performance overhead compared to running things natively. However, it is worth noting that the applications that run inside of Docker containers actually run natively. Your Docker containers share the kernel with their host operating system. So there is no double overhead in running a container inside our VM. However, we still suffer some performance penalty by having virtualized in the first place.
Many of the applications you will be interested in deploying are already configured for very easy use with Docker. You can find public repositories of many of your favorite applications set up on Docker Hub.
This tutorial uses an Ubuntu operating system.
The official Docker documentation provides a lot of useful information to this end. Below we summarize only the steps outlined in that article. If you wish to understand an individual step or if something goes wrong, please refer to the article.
sudo apt-get install \apt-transport-https \ca-certificates \curl \software-properties-commoncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo apt-key fingerprint 0EBFCD88sudo add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) \stable"sudo apt-get updatesudo apt-get install -y docker docker.io
And if all is well, you should have Docker installed on your system.
You can test that your setup is working correctly by running:
sudo docker pull hello-worldsudo docker run hello-world
If all goes well, you will have a small "hello world"-like output and return to your terminal, and should look something like this: