Skip to content

Docker, What is it, what is it for?

Docker is a container management tool. A container is understood as a portable, isolated and independent execution environment, you can imagine it as if it were a virtual machine.

In this environment we will have our operating system and our executable packaged to be able to be started on any host (regardless of its own operating system). Docker is an executable that allows us to start, stop and work with these containers.

Ubuntu 22 Installation

  1. Update packages
sudo apt update
  1. Update certificates so that apt can connect via SSL

sudo apt install apt-transport-https ca-certificates curl software-properties-common
3. Download the GPG signing key to obtain the Docker repository keys
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4. Add the Docker repository to our sources for APT (sources.list)
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5. Now that our APT can access the docker repos, we update
sudo apt update
6. And now we can install docker community edition (ce)
sudo apt install docker-ce -y   # -y == non interactive installation
7. By default Docker is prepared to work only with root, or with the docker group, so we need our current user to be added to that work group to be able to use docker
sudo usermod -aG docker ${USER}
8. We verify that it has been installed correctly
$ docker -v
Docker version 24.0.5, build 24.0.5-0ubuntu1~20.04.1