How to Install and Use Docker CE on RHEL 10 | CentOS Stream 10

Docker can be defined as among the most prominent and most used platforms of containerization available today in the industry space. It offers a great Community Edition (CE) that allows software developers to handle their containers efficiently across different types of Linux systems. In this all-inclusive installation guide, we will systematically take you through the full installation process step by step and explain how to efficiently use Docker CE, especially upon RHEL 10. It is worth noting that Docker cannot be obtained easily through the default repositories of the named operating system.

Prerequisites

Before beginning the installation, ensure you have the following:

  • A RHEL 10 | CentOS Stream 10 system.
  • A user with sudo privileges or root access.
  • Internet access to download the Docker packages.

Step 1: Install Required Dependencies

Before we can install Docker CE, let’s first install the required dependencies, which will provide the necessary tools to enable you configure the repos and the manage packages:

sudo dnf install -y yum-utils

Step 2: Add the Docker CE Repository

So, as we mentioned earlier, Docker CE is not available in the default RHEL repositories, so we’ll use the CentOS Docker CE repository for both CentOS Stream and RHEL:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

This repository is maintained by Docker and is compatible with RHEL-based systems, including RHEL 10:

Step 4: Install Docker CE

Update your system and install Docker packages:

sudo yum update
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 5: Start and Enable Docker

After Docker is installed, start and enable it to start at boot:

sudo systemctl enable --now docker

To run Docker commands as a non-root user, add your user to the docker group:

sudo usermod -aG docker $USER
newgrp docker

Step 6: Verify Docker Installation

Verify that docker and docker-compose have been successfully installed:

docker version
docker compose version

Additionally, you can run the hello-world container:

docker run --rm hello-world

Step 7: Using Docker on RHEL 10 CentOS Stream 10

Here’s how you can use Docker:

1. Running Containers

To run a Docker container, for example, you can run an Nginx web server container with the command below:

docker run -d -p 8080:80 nginx

Access Nginx on port 8080:

2. Listing Running Containers

To list all running Docker containers:

docker ps

To list all containers, including stopped ones:

docker ps -a
3. Stopping and Removing Containers

To stop a running container:

docker stop <container-id or container-name>

To remove a stopped container:

docker rm <container-id or container-name>
4. Pulling Docker Images

To pull a Docker image from Docker Hub:

docker pull ubuntu

List the pulled images:

docker images

Run the Ubuntu container:

docker run -it ubuntu

5. Building Docker Images

Docker images can be built by running the docker build command along with a dockerfile:

docker build -t my-custom-image .

This will create an image named my-custom-image from the current directory (where the Dockerfile is located).

6. Docker Compose

Docker Compose is a tool for defining and running multi-container applications. It simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single YAML configuration file. Then, with a single command, you create and start all the services from your configuration file.

To use it, create a docker-compose.yml file with the necessary configuration. For example:

services:
  web:
    image: nginx
    ports:
      - "8080:80"
  db:
    image: mysql
    environment:
      MYSQL_ROOT_PASSWORD: P@ssw0rd

Then, run

docker compose up -d

List the running containers:

docker ps

Conclusion

With the smooth operation of your system’s Docker, you get the amazing ability to take full use of its significant features, which enable you to efficiently build, deploy, and scale applications through isolated containers specially crafted to operate autonomously of each other. No matter if you deal with relatively basic applications or oversee complex and complicated microservices architectures, the use of Docker on RHEL 10 becomes the perfect solution to maintain the same consistency across all your various environments, allowing your deployment processes to be much more reliable and streamlined.

More articles from us:

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Oracle VM VirtualBox is an exceptionally formidable and extremely handy open-source Type 2 hypervisor that gives users the capability of […]

A helpdesk plays an important role in a company or organization. It acts as a one-stop point of contact that […]

Imagine you are a customer service agent dealing with customers from different clients and they get in touch with you […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.