Wondering how to install Docker CE on AlmaLinux? We can help you.
While Docker is an open-source containerization platform to run on Windows, Linux, and macOS, AlmaLinux OS is an open-source Linux distribution derived from the RHEL source.
As part of our Docker Hosting Support, we assist our customers with several Docker queries.
Today, let us see how to install Docker CE on AlmaLinux OS 8.
How to install Docker CE on AlmaLinux 8
Moving ahead, let us see the steps our Support Techs suggest in order to perform the installation.
Step 1: Update AlmaLinux System
Initially, we need to update AlmaLinux System OS packages to the latest versions.
$ sudo dnf -y update
If we have kernel-related updates, our Support Techs recommend performing a system restart:
$ sudo reboot
Step 2: Add Docker CE repository
Before we install Docker CE we have to add an open Docker CE repository with rpm packages for Red Hat-based Linux systems.
We install yum-utils which provides the yum-config-manager command-line tool:
$ sudo dnf install -y yum-utils
Once done, we run the commands below to add Docker CE repository to the AlmaLinux OS 8 system:
$ sudo yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo
Then we 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 on AlmaLinux 8
Now we can proceed to install Docker CE on AlmaLinux 8:
$ sudo dnf -y install docker-ce docker-ce-cli containerd.io
Once the installation command completes, we start the service:
$ sudo systemctl enable –now docker
Then we check the service status:
$ systemctl status docker ● docker.service – Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2021-04-21 12:38:02 EAT; 15s ago Docs: https://docs.docker.com Main PID: 73811 (dockerd) Tasks: 11 Memory: 48.9M CGroup: /system.slice/docker.service └─73811 /usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock
Later we add a user to the docker group:
$ sudo usermod -aG docker $USER newgrp docker
We can confirm if we are able to run any docker commands without Sudo:
$ docker –version Docker version 20.10.6, build 370c289
Step 4: Run docker container
We test our Docker CE installation on AlmaLinux 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
We 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/
This confirms our Docker installation on AlmaLinux OS 8 is working fine.
A common error
Error starting daemon: Error initializing network controller: Error creating default “bridge” network: failed to parse pool request for address space “LocalDefault” pool “” subpool “”: could not find an available predefined network
We may come across this error while restarting Docker.
This relates to the machine having several network cards. It can also happen in machines with VPN.
However, we can temporarily stop it, start docker and restart the VPN.
In addition, we can start docker manually:
/usr/bin/docker daemon –debug –bip=192.168.y.x/24
Here, the 192.168.y.x is the MAIN machine IP and /24 the ip netmask.
After starting, we can kill the docker and start as usual. However, if we clean the docker cache, we need to do this again.
[Need help with the installation? We can help you]
In short, today we saw how our Support Techs go about installing Docker CE on AlmaLinux.