August 8, 2020

How to Install Docker CE on CentOS 8 and RHEL 8

 

Docker is a daemon-based container engine which allows us to deploy applications inside containers. 

Docker is available in two versions,

  • Docker CE (Community Edition)
  • Enterprise Edition (EE)

In this guide we will learn how to install Docker CE (Community Edition) on CentOS 8 or RHEL 8 Server.

System Requirements for Docker CE

  • Minimal CentOS 8 / RHEL 8
  • Sudo or root privileges
  • Internet Connection

Step 1: Enable Docker CE Repository

As we said above, docker packages are not available anymore on CentOS 8 or RHEL 8 package repositories, so run following dnf command to enable Docker CE package repository.


[root@docker-ce ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

Step 2: Install Docker CE using dnf command

Once the docker ce repo has been configured successfully then run following command to verify which version of docker is available for installation

[root@docker-ce ~]# dnf list docker-ce
Available Packages
docker-ce.x86_64              3:19.03.5-3.el7                    docker-ce-stable
[root@docker-ce ~]#

Now, use beneath dnf command to install latest version of docker,

[root@docker-ce ~]# dnf install docker-ce --nobest -y

After the installation of docker, start and enable its service using the following systemctl commands

[root@docker-ce ~]# systemctl start docker
[root@docker-ce ~]# systemctl enable docker

Run the following command to verify installed docker version

[root@docker-ce ~]# docker --version
Docker version 18.06.3-ce, build d7080c1
[root@docker-ce ~]#

Step 3: Verify and test Docker CE Engine

To verify whether docker ce engine has been setup correctly or not, try to spin up a “hello-world” container using below docker command

[root@docker-ce ~]# docker run hello-world

Output of above command

As we can see the informational message in above output which confirms docker engine is setup correctly on CentOS 8 / RHEL 8 Server. Let’s move to docker compose installation.

Step 4: Install Docker Compose

As we know that docker compose is used to link multiple containers using a single command. In other words, Docker Compose is useful where we need to launch multiple containers and these containers depends on each other. Examples like launching LAMP/ LEMP applications (WordPress & Joomla etc) insider containers.

Run the following commands to install docker compose on CentOS 8 / RHEL 8,

[root@docker-ce ~]# dnf install curl -y
[root@docker-ce ~]# curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Note: Replace “1.25.0” with docker compose version that you want to install but at this point of time this is the latest and stable version of docker compose.

Set the executable permission to docker-compose binary

[root@docker-ce ~]# chmod +x /usr/local/bin/docker-compose

Verify the docker compose version by running the following command.

[root@docker-ce ~]# docker-compose --version
docker-compose version 1.25.0, build 0a186604
[root@docker-ce ~]#

That’s all from this tutorial, I hope these steps help you to setup docker and docker compose on CentOS 8 and RHEL 8 server.

8 comments:

  1. You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. WHY ARE BITCOIN BLOCKCHAIN VOLUMES RISING?

    ReplyDelete
  2. Your web log isn’t only useful but it is additionally really creative too. Artificial Intelligence Technology in Business

    ReplyDelete
  3. A virtual private network or VPN service is the tool that is commonly used these days to protect the privacy of users when surfing the web. They can do this by creating a sort of encrypted tunnel where all the data that you submit on the web can pass through. Because it's encrypted, it will be impossible for people who intercept the data to read and understand it. dark web sites

    ReplyDelete
  4. A VPN (Virtual Private Network) connects a PC or laptop over the Internet to the office network allowing the remote user to work as if they were sitting at their desk in the office. Normally, setting up a VPN requires significant technical skills as the office firewall needs to be reconfigured, the VPN server has to be setup and the whole lot has to be made secure. Once setup and working, the VPN server needs to be monitored (to ensure there is nothing suspicious going on) and maintained with the latest security patches provided by the VPN ... work from home

    ReplyDelete
  5. There are several factors that may effect the speed of a VPN connection. This article describes five of the most common ones, and gives guidance on how to mitigate them. auto sliding gate bd

    ReplyDelete
  6. It's consistent with say that similarly as an all around planned touch board can upgrade your framework, an inadequately planned board can similarly cheapen it or even render it futile. Yealink Meetingbar A30
    Yealink A30 Teams

    ReplyDelete
  7. A touch board configuration is just a graphical connection point that discussions to mechanization hardware, it fuses pictures, text, fastens or in any event, moving pictures and transferred video.Yealink A20 Teams
    Yealink A20 Price

    ReplyDelete

How to Install Docker CE on CentOS 8 and RHEL 8

  Docker  is a daemon-based container engine which allows us to deploy applications inside containers.  Docker is available in two versions,...