hello @ajey,
Install using the repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
SET UP THE REPOSITORY
Install the yum-utils
package (which provides the yum-config-manager
utility) and set up the stable repository.
$ sudo yum install -y yum-utils
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
INSTALL DOCKER ENGINE
- Install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
$ sudo yum install docker-ce docker-ce-cli containerd.io
- Docker is installed but not started. The
docker
group is created, but no users are added to the group. - To install a specific version of Docker Engine, list the available versions in the repo, then select and install:a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated:
$ yum list docker-ce --showduplicates | sort -r
- Start Docker.
$ sudo systemctl start docker
- Verify that Docker Engine is installed correctly by running the
hello-world
image.
$ sudo docker run hello-world