To install and use Docker, you must manually install it setting up Docker’s repositories and installing it from them.
Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver:
$ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
Use the following command to set up the stable repository:
$ sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
Install the latest version of Docker CE and containerd:
$ sudo yum install -y docker-ce docker-ce-cli containerd.io
$ sudo systemctl start docker
At this point, Docker CE is installed and running. The docker group is created but no users are added to it, so you need to use sudo to run Docker commands. To add the bitnami user to the docker group, execute the following command:
$ sudo usermod -aG docker bitnami
You need to log out and log back in your shell for re-evaluate your group membership. You can verify that you can run docker commands without sudo:
$ docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Check the following links for more information on this: