Nowadays software portability has become increasingly relevant. The architecture of computers and operating systems is constantly evolving; applications become larger in every sense. It often happens when administrator needs to transfer the program to another machine without installing and configuring it from scratch. For these purposes, a special software was developed (like Docker). This article describes how to install Docker on Ubuntu and other GNU/Linux systems.
Docker’s Software and Hardware Requirements
Docker installation is happening in the same way as a regular program. Despite the fact that it has quite complex structure and working principles, it does not need a high requirements for effective work:
- 64-bit system;
- System kernel version above 3.10;
- High-speed internet;
- Static IP;
- At least 4 GB of RAM for workers node;
- At least 8 GB for corporate use;
- 3 GB or more free disk space;
- At least 4 GB swap.
Note! With an active VPN connection, the program may crash. In this case, first enable Docker (in particular, the daemon), and then VPN.
Installing Docker in Linux
There are two versions of this software: Community Edition and Enterprise Edition. The main difference is that when using EE, you can also get advice from the development company on setting up and using Docker at any time. In this example we are using the CE version. It is assumed that prior to the installation, no other instances of this software were installed in the system. Otherwise, delete them.
On Ubuntu, Mint, and other Debian-based systems, Docker is missing from the base repositories.
First, you need to download the supporting tools:
sudo apt update && sudo apt install aptitude && yes | sudo aptitude install apt-transport-https ca-certificates curl software-properties-common
Next, load and fix the Docker repository key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Write the Docker repository to the general list of software sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Update the list of repositories and install the program:
sudo aptitude update && yes | sudo aptitude install docker-ce
Run the daemon:
sudo /etc/init.d/docker start
“Red Hat”-based Systems
Here the situation is the same: there is no Docker in standard repositories, you need to add it manually.
First we load the auxiliary utilities:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Add the Docker repository:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install the program:
sudo yum install docker-ce
Turn on the daemon:
sudo systemctl start docker
On Arch, Manjaro, and the like, the entire installation can be done with one command:
yes | sudo pacman -S docker
The daemon is also enabled using systemd:
sudo systemctl start docker
To test the program, load the test container “hello-world” with the command:
docker run hello-world
Using the run command may be prohibited due to a lack of privileges. To solve the problem, just add the user to the docker group:
sudo gpasswd -a USERNAME docker
View a list of all containers installed on the computer:
More details about all the program options can be listed with the command:
Download all images from Docker Hub.