Add the necessary repo to the instance:
cd /etc/yum.repos.dsudo vim docker-ce.repo
Add these lines on top
[centos-extras]name=Centos extras - $basearchbaseurl=http://mirror.centos.org/centos/7/extras/x86_64enabled=1gpgcheck=0
Save and run the following command
sudo yum -y update
This will prevent:
---> Package docker-scan-plugin.x86_64 0:0.8.0-3.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
---> Package libseccomp.x86_64 0:2.3.1-4.el7 will be installed
--> Finished Dependency Resolution
Error: Package: 3:docker-ce-20.10.8-3.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
Error: Package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64 (docker-ce-stable)
Requires: fuse-overlayfs >= 0.7
Error: Package: docker-ce-rootless-extras-20.10.8-3.el7.x86_64 (docker-ce-stable)
Requires: slirp4netns >= 0.4
Error: Package: containerd.io-1.4.9-3.1.el7.x86_64 (docker-ce-stable)
Install docker
sudo yum -y updatesudo yum install -y docker-enginesudo systemctl start dockersudo systemctl enable dockersudo usermod -aG docker $USER
logout and login again
docker ps -a
Now install Docker Compose.
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-compose
check that was installed with
docker-compose -v
Because you always need it....
sudo yum install -y git