How to install and setup Docker on RHEL 7/CentOS 7

htt‮:sp‬//www.lautturi.com
How to install and setup Docker on RHEL 7/CentOS 7

To install and set up Docker on RHEL 7 or CentOS 7, you can use the following steps:

  1. Install the required packages:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

This will install the yum-utils and device-mapper-persistent-data packages, which are required to set up the Docker repository.

  1. Add the Docker repository:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

This will add the Docker Community Edition (CE) repository to your system.

  1. Install Docker:
sudo yum install docker-ce

This will install the latest version of Docker CE available from the repository.

  1. Enable and start the Docker service:
sudo systemctl enable --now docker
  1. Add your user to the docker group:
sudo usermod -aG docker $USER

This will allow you to run Docker commands without using sudo.

  1. Test the installation:
docker run hello-world

This will run a simple Docker container, which will print a message indicating that Docker is working correctly.

Created Time:2017-10-28 21:39:04  Author:lautturi