This is just a short post paraphrasing the very good (and verbose!) instructions on the Docker site here: https://docs.docker.com/install/linux/docker-ce/centos/.
Basically, to install Docker CE on a fresh Centos 7.x server, you have to:
- Install the YUM config manager.
- Install device-mapper-persistent data and LVM (for the storage driver).
- Use the YUM config manager to add the stableĀ docker YUM repository.
- Install docker.
- Start docker.
- Test that it worked.
This script does all of that and basically just saves you from skimming through the linked page repeatedly to find the few commands you need.
sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo sudo yum install -y docker-ce docker-ce-cli containerd.io sudo systemctl start docker sudo docker run hello-world
Assuming it works, you should see “Hello from Docker!” among various other output on your screen.