Installing Docker
We will be installing Docker in an Ubuntu system. For other OSs, please refer to https://docs.docker.com/engine/install/.
To install Docker, we need to install supporting tools to allow the apt
package manager to download Docker through HTTPS. Let’s do so using the following commands:
$ sudo apt-get update $ sudo apt-get install -y ca-certificates curl gnupg
Download the Docker gpg key and add it to the apt package manager:
$ sudo install -m 0755 -d /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg $ sudo chmod a+r /etc/apt/keyrings/docker.gpg
Then, you need to add the Docker repository to your apt
configuration so that you can download packages from there:
$ echo \ "deb [arch="$(dpkg --print-architecture)" \ signed-by=/etc/apt/keyrings/docker.gpg] \ https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo ...