Install Docker CE on CentOS 7

Install Docker CE on CentOS 7

Overview

In this tutorial I will show how to Setup Docker CE for CentOS 7. The default Docker version that comes with CentOS is very old and only supports docker-compose syntax version 2. To use a higher level of docker-compose syntax we need the latest Docker CE. This tutorial is the short version of the official Docker CE tutorial.

Setup Docker CE for CentOS 7

Remove old version

yum remove docker*

Install Docker CE Prerequisites

yum install -y yum-utils device-mapper-persistent-data lvm2

Add Docker CE Repository

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

Install Docker CE

yum install docker-ce docker-ce-cli containerd.io

Enable Docker CE to run on startup

systemctl enable docker

Start Docker CE

systemctl start docker

Test Docker CE

docker run hello-world

All Done