How to install Docker On CentOS 8/RHEL 8
Using Docker, you can build, test, and deploy applications quickly and easily. Despite its portability to run anywhere, regardless of what operating system is used, it has gained popularity among users in recent years. Using Docker, the application is distributed in an efficient, lightweight manner. A container uses fewer resources than a virtual machine because it operates on a single kernel.
RHEL 8 / CentOS 8 is the latest release. Red Hat has developed its own tools, buildah, and podman, which are designed to work with docker images and not require a daemon, allowing users to create containers without the need to be granted special permissions.
What is Docker?
Using Docker, applications can be created and distributed inside standardized environments which can be mimicked, independently of the host system, with ease. On the new release of Red Hat Enterprise Linux 8, Docker has been replaced by buildah and podman, two new tools developed by Red Hat themselves.
Docker CE (Community Edition) can still be installed via an external repository. We will learn how to install the repository in this tutorial; however, note that it offers no support for Red Hat Enterprise Linux, and the community version of Docker was originally designed to run on CentOS 7 (an RHEL clone). Due to this, issues exist. Below, we discuss them.
The purpose of this post is to show you how to install Docker on CentOS 8 / RHEL 8.
Install Docker On CentOS 8/RHEL 8
There are two types of Docker versions:
- Community Edition
- Enterprises Edition
What is Community Edition(CE)?
Docker Community Edition is now Docker Engine, and, as the name suggests, it is a community-supported and free version of Docker.
There will be two versions of the community edition: Edge and Stable. Each month, Edge will have new features. The stable release is scheduled for every quarter. Likewise, the stable version will be updated four months after the initial release with security and bug fixes. Upgrades from older versions will be possible during this update cycle.
There is not much if any, the difference at the source code level between the two versions, indeed. The Docker CE and EE editions rely on Docker’s open source project, which is built with Docker’s partner community and contributes to its open, modular core,” said Messina.”
What is Enterprise Edition (EE)?
There are three versions of Docker Enterprise Edition: basic, standard, and advanced. In addition to the Docker platform, support, and certification that is included with the Basic edition, the Standard and Advanced editions also include container management (Docker Datacenter) and Docker security scanning.
IBM, Microsoft, Canonical, HPE, Alibaba, and Canonical are all partners supporting Docker EE. Docker EE is available for free download from the official site for those interested in testing it.
A certification program is also offered by Docker to help third-party vendors ensure their products work with Docker EE.
Installation Steps of Docker CE on CentOS 8/RHEL 8 Server
Lat’s get started
Step:1) Configure Docker Repository
Installing Docker Engine for the first time on a new host requires setting up the Docker repository. Once you have downloaded Docker, you can install and update it.
Let’s configure the yum repository.
Add a repository called docker.repo to /etc/yum.repos.d.
You will find some files with the extension .repo here. This file can be edited or a file can be created and added to the repository URL. baseurl location path is given in below
Step 2) Installing Docker
After configuring the Decker repo file, save it and close it.
Now check the docker repository to see if it is configured correctly or not. use the yum repolist.
Now finally install the docker with this given command.
Using the — nobest option ensures that the yum package manager searches for docker-ce versions that satisfy all their dependencies before attempting to install them
After installing the docker-ce you can check the docker software install or not. And also check the docker version with the given command
To see the docker software:
To see the docker version:
Install Docker, run the daemon, and enable Docker to start automatically at bootup. Make sure it’s running:
If the service is not running and dead, then the output should look like this:
Step 3) Start and enable Docker service
Use the following systemctl commands to start and enable docker after installation
To start the docker service:
to enable the docker service:
after start and enable the service check the docker status. If the service is running and active, then the output should look like this:
Step 4) Working with Docker Images
Images are used to build Docker containers. These images are pulled by default from Docker Hub, a registry managed by Docker. You can find Docker images for most Linux distributions and applications you’ll need at Docker Hub.
Check if the Docker CE engine has been properly set up by spinning up a “hello-world” container using the following docker command:
The output will indicate that Docker is working correctly:
The hello-world image could not be found locally, so Docker downloaded it in the default repository, Docker Hub. After Docker downloaded the image, it created the container using the image, from which the application executed, displaying the message.