How to install AlmaLinux 8 Image in Docker Container

Do you want to install and try AlmaLinux 8 on a Docker container running on Windows, Linux, or macOS? Then here are the steps to follow.

Docker provides containerized virtualization to run various applications or services instantly using the images available on Docker Hub. Even we can create our own Images. Apart from the lightweight and strong isolation, Containers also make it possible to split applications into many small microservices, that can be communicated with each other. It makes us or developers’ jobs less messy if we are planning to install multiple services but don’t want them to interfere while programming or making some changes to them.  For example, we can install Apache and Nginx in separate containers while the MySQL in some other, so that while doing some change in one container, let’s say Apache and something goes wrong rest of the two will be unaffected.

Well, I am not here to talk about the benefits of Docker, instead, let you know the steps to test the latest CentOS 8 alternative AlmaLinux 8.3 by creating a Container for it on Docker.

Install or Run AlmaLinux 8 Image in Docker container

If you are looking for a tutorial to download and run this Linux on Virtual Machine, then see our article – AlmaLinux Linux ISO installation on VirtualBox

Before going through the below steps you must ensure that the Server or Desktop PC you are using has Docker installed already. If not then, see our tutorial to download and set up Docker on RHEL, CentOS, or AlmaLinux 8.

1. Check Docker Service

Although it is not a necessary step, yet, make sure that the Docker service is running on your system without any error. Here is the command to do that:

sudo systemctl status docker

 

2. Download AlmaLinux 8 Docker Image

The image of AlmaLinux is already present in the Docker Hub repository, thus we just only need to run the Pull command to fetch and save it on our system, locally.

docker pull dokken/almalinux-8

Output:

Using default tag: latest
latest: Pulling from dokken/almalinux-8
da3affed2430: Pull complete
e7816d095dfc: Pull complete
Digest: sha256:9f2fa202d089afd74c22108521d8627425203f2cba37750c0841f655c5318e73
Status: Downloaded newer image for dokken/almalinux-8:latest
docker.io/dokken/almalinux-8:latest

Check the available Images:

docker images

Docker Image of AlmaLinux 8

 

3. Run AlmaLinux Container

Once you have the Image on your system, let’s create and start a Container using it. Well, if you have seen in the above screenshot, this free Redhat Linux image for Docker is with the name “dokken/almalinux-8″ which may be a little bit difficult for some users to remember, so, we will create a container with a different name let’s say, only “almalinux”.

docker run -d almalinux dokken/almalinux-8

Name or Rename AlmaLinux container

Now, see whether the created container is running in the background or not

docker ps

 

Connect background Running Container

As we can see in the previous command the AlmaLinux container is already running in the background, let’s connect it to test and run the various commands over it.

docker exec -it almalinux /bin/bash

Check OS-version

cat /etc/os-release

Connect and run background running container

 

Hence, in this way, we can test our AlmaLinux 8 on Docker container running on some Cloud such as AWS, Google Cloud, Digital Ocean or on your personal Linux, Windows, or macOS.

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.