Welcome lovely people to today’s guide on how to install Docker CE on Rocky Linux 8 / AlmaLinux OS 8. Docker CE is a free to use and open source containerization platform designed to run on Windows, Linux and macOS. The CE version of Docker is a rebrand of the Docker open source solution. There is an Enterprise Edition if you need support from Docker Inc on your container platform.
Docker is used throughout the development lifecycle from Development to Production – for fast, easy and portable application development, both on-prem and in the cloud. The Docker’s comprehensive end to end platform includes UIs, CLIs, APIs and security that are engineered to work together across the entire application delivery lifecycle.
In this guide we will walk you through the installation of Docker CE on AlmaLinux OS 8. AlmaLinux OS is an open source Linux distribution derived from RHEL source. It is created by the community and for the community.
Step 1: Update System Packages
Start the installation by updating AlmaLinux / Rocky Linux 8 system OS packages to the latest versions.
sudo dnf -y update
If you have kernel related updates it is recommended to perform a system restart:
sudo reboot
Step 2: Add Docker CE Repository
There is an open Docker CE repository with rpm packages for Red Hat based Linux systems. We’ll add this repository before we can install Docker CE on Rocky Linux 8 / AlmaLinux OS 8.
Install yum-utils which provides yum-config-manager command line tool.
sudo dnf install -y yum-utils
Once the tool is installed run the commands below to add Docker CE repository to your AlmaLinux / Rocky Linux 8 system:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Confirm repository is available for use:
$ sudo dnf repolist
repo id repo name
appstream AlmaLinux 8 - AppStream
baseos AlmaLinux 8 - BaseOS
docker-ce-stable Docker CE Stable - x86_64
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras AlmaLinux 8 - Extras
powertools AlmaLinux 8 - PowerTools
Step 3: Install Docker CE
Now that Docker repository has been added to our system we can proceed to install Docker CE on AlmaLinux 8 / Rocky Linux 8:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin
The commands above will install the latest version of Docker Engine and containerd.
==================================================================================================================================================================
Install 12 Packages
Total download size: 107 M
Installed size: 438 M
Wait for the installation commands to complete then start the service:
sudo systemctl enable --now docker
Check service status:
systemctl status docker
Add your user to docker group
sudo usermod -aG docker $USER
newgrp docker
Confirm if you’re able to run any docker commands without sudo:
$ docker --version
Docker version 27.0.3, build 7d4bcd8
Step 4: Run Docker Container
Let’s test our Docker CE installation on AlmaLinux 8 / Rocky Linux 8 by pulling alpine linux and hello-world images:
$ docker pull alpine:latest
latest: Pulling from library/alpine
540db60ca938: Pull complete
Digest: sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest
$ docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:f2266cbfc127c960fd30e76b7c792dc23b588c0db76233517e1891a4e357d519
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
Run a docker container from the alpine image:
$ docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
We can confirm our Docker installation on AlmaLinux OS 8 / Rocky Linux 8 is working fine. You can now build your containerized applications with Docker and helpful tools such as Docker Compose. And eventually migrating them to Kubernetes environment.