We are aware of a potentially service impacting issue. Learn more

How to install Docker CE on CentOS 8 Print

  • centos 8, docker ce, linux
  • 0

What you'll need 

The only things you'll need are: 

  • A working instance of CentOS 8, you can order one real quick here
  • A user with sudo privileges

How to add the necessary Docker repository 

We're going to be using the dnf config-manager utility to add the Docker repository. To do this, open a terminal window and issue the command: 

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

How to locate an installable version of Docker CE

As of now, Red Hat has blocked the installation of docker-ce, so if you attempt to run the command sudo dnf install docker-ce, it will fail. Instead, you must install a specific version of Docker. To find out which versions are available, issue the command: 

dnf list docker-ce --showduplicates | sort -r

From that list, we can see version docker-ce-3:18.09.1-3.el7 is available for installation

How to install Docker CE 

To install that version, issue the command: 

sudo dnf install docker-ce-3:18.09.1-3.el7

In order to force DNS resolution to work within Docker containers, the firewalld must be disabled. To do that, issue the command: 

sudo systemctl disable firewalld

Next we'll start and enable the docker daemon with the command: 

sudo systemctl enable --now docker

Finally, add your user to the docker group with the command: 

sudo usermod -aG docker $USER

 

Congratulations, you now have Docker CE running and ready to work on CentOS 8. Begin deploying those containerized applications.


Was this answer helpful?

« Back