Installing Docker

How to install Docker on CentOS 7?

Prerequisites:

  • A maintained/supported version of CentOS (Docker doesn’t test or support outdated versions)
  • A user account with sudo privileges
  • Terminal access (Right-click desktop, click Open in Terminal)
  • CentOS Extras repository – this is enabled by default, but if yours has been disabled you’ll need to re-enable it
  • Software package installer Yum.

Steps for installing Docker:

Step 1: Update Docker Package Database.

  • sudo yum check-update

Step 2: Install the Dependencies.

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

Step 3: Add the Docker Repository to CentOS.

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

Step 4:  Install Docker On CentOS Using Yum.

  •  sudo yum install docker

Step 5:  Manage Docker Service.

  • To start the service, enable it to run at startup. Run the following commands in the order listed below.
  1. Start Docker:
  • sudo systemctl start docker

      2. Enable Docker:

  • sudo systemctl enable docker

      3. Check the status of the service with:

  • sudo systemctl status docker