Install Docker on CentOS 7

Docker May 02, 2020

STEP 1 - Update the package

root# yum check-update

STEP 2 - Install Dependencies

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

The –y switch indicates to the yum installer to answer “yes” to any prompts that may come up. The yum-utils switch adds the yum-config-manager. Docker uses a device mapper storage driver, and the device-mapper-persistent-data and lvm2 packages are required for it to run correctly.

STEP 3 - Add the Docker Repository to CentOS

root# yum-config-manager --add-repo 


https://download.docker.com/linux/centos/docker-ce.repo

STEP 4 - Install Docker On CentOS Using Yum

root# yum install docker

Your operating system may ask you to accept the GPG key. This is like a digital fingerprint, so you know whether to trust the installation.

The fingerprint should match the following format:

060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35

STEP 5 - Manage Docker Service

Start Docker Service

root# systemctl start docker

Enable Docker on Startup

root# systemctl enable docker

Check Docker Service

root# systemctl status docker
Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.