About Me

header ads

[Guide] Docker, how to install the platform on Ubuntu 20.04

docker-ubuntu

In this mini-guide, we will see how to install Docker, the popular open-source platform for creating and managing Linux containers. We will use Ubuntu 20.04 Focal Fossa, the latest version of Canonical's operating system, as the installation environment.

Docker, what it is and how to install it

A container is essentially a virtual, modular, and light machine. Thanks to its use, we will, therefore, have coherence between the various development, test, and production environments. This makes this technology very widespread in the business environment, offering maximum portability, configurability, and isolation.
So what's the difference between virtualization and containerization? In a nutshell, in virtualization, we install a hypervisor on the system, which emulates the hardware to run the various virtualized OS. The containers, however, are run natively: the operating system will be shared among all.

docker-virtual-ubuntu

Installation on Ubuntu 20.04 Focal Fossa is very simple. Just follow this procedure:
  • install the package with sudo apt install docker.io
  • enable the Systemd service: sudo systemctl enable –now docker
  • add the current user to the administration group: sudo usermod -aG docker $USER
  • install compose:

sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

  • add permissions sudo chmod +x /usr/local/bin/docker-compose


Note: at the moment I am writing this guide on the official server there is still no section dedicated to Focal Fossa. This will cause an error on a subsequent apt update. So for now, we need to make the following change to the /etc/apt/sources.list.d/docker.list file

#deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable

Docker installation is complete. One last note, for those who want to follow the procedure indicated on the official documentation. A change must also be made here, in this step:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Replacing, for now, (lsb_release -cs) with eoan.

I will update this guide when the section dedicated to the new version of Ubuntu is added.

Post a Comment

0 Comments