How to install Docker Engine on a Scaleway Instance running Ubuntu Jammy Jellyfish (22.04 LTS)
Docker is a powerful and widely-used open-source platform that enables developers to automate the deployment, scaling, and management of applications in a consistent and efficient manner.
The tool allows you to run software in a standardized environment called a “container” that encapsulates an application along with all its dependencies and configurations.
Docker Engine is the core component of the Docker platform. It is the runtime that allows you to create, run, and manage Docker containers. Docker Engine is responsible for building, running, and distributing containers. It includes the Docker daemon, a long-running process responsible for managing Docker objects like images, containers, volumes, and networks. The main components that you install by following this tutorial are:
- Docker daemon: The Docker daemon is a background service responsible for managing Docker containers, images, networks, and volumes. It listens for Docker API requests and handles container lifecycle operations like starting, stopping, and monitoring containers.
- Docker CLI: The Docker Command Line Interface (CLI) is a tool that allows you to interact with Docker. It provides a set of commands to manage containers, images, networks, volumes, and other Docker resources.
- Docker Compose: Docker Compose is a tool that allows you to define and manage multi-container applications using a YAML file. It simplifies the process of defining the services, networks, and volumes required for your application stack.
- Containerd: containerd is an open-source container runtime that serves as the industry-standard container runtime interface (CRI) between higher-level container management systems (such as Docker and Kubernetes) and the low-level kernel features responsible for running containers.
Prior to installing Docker Engine on a new host machine, you must configure the Docker repository. Once the repository is set up, you can proceed to install and keep Docker updated directly from the repository.
- Log in to your Instance using SSH:
- Update the
aptpackage cache and upgrade the software already installed on your Instance to the latest version available in the repository:apt update && apt upgrade -y
Install packages that are required to download the required packages for Docker using
aptvia an HTTPS connection.apt install ca-certificates curl gnupg
Add the official Docker GPG key to validate the downloaded packages.install -m 0755 -d /etc/apt/keyringscurl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpgchmod a+r /etc/apt/keyrings/docker.gpg
Use the following command to configure the Docker repository:echo \"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \tee /etc/apt/sources.list.d/docker.list > /dev/null
aptpackage cache:apt update
Install the latest version of Docker Engine, containerd, and Docker Compose:apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Verify that the installation of Docker Engine was successful by running the following command. This command will download a test image and execute it within a container. Once the container is running, it displays a confirmation message and terminates.docker run hello-world
You have now successfully installed the latest version of Docker Engine on your Instance.