Skip to content

Instantly share code, notes, and snippets.

@iliion
Created November 12, 2021 16:45
Show Gist options
  • Save iliion/a3265cadf2db5199a7bc725e70ddad6d to your computer and use it in GitHub Desktop.
Save iliion/a3265cadf2db5199a7bc725e70ddad6d to your computer and use it in GitHub Desktop.
Install Docker Engine {CentOS7}

Uninstall old versions

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

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

Start Docker.

sudo systemctl start docker

Verify that Docker Engine is installed correctly by running the hello-world image.

sudo docker run hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment