updated: 9th of December 2020
published: 7th of December 2020
Docker and docker-compose are a very common tools for developing and deploying applications.
In this post I will cover the process of installing Docker engine and Docker compose on Centos 8 minimal.
Ensure that there are no default versions of Docker install. There should not be, but it's worth confirming.
rpm -qa | grep docker
Add the Docker community edition repository.
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Install Docker, the CLI tools and containerd.
sudo dnf install -y docker-ce docker-ce-cli containerd.io
Start and enable Docker.
sudo systemctl start docker
sudo systemctl enable docker
Add the docker0 interface to the trusted zone in firewalld .
sudo firewall-cmd --permanent --zone=trusted --add-interface=docker0
sudo firewall-cmd --reload
Add your user to docker group.
sudo usermod -aG docker $USER
Now logout and log back in or run the newgrp docker command.
Confirm that you can run docker commands.
docker pull hello-world
# Output
Using default tag: latest
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:e7c70bb24b462baa86c102610182e3efcb12a04854e8c582838d92970a09f323
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
Install the docker-compose binary from the Github release page.
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Make the docker-compose binary executable.
sudo chmod +x /usr/local/bin/docker-compose
Symlink the docker-compose binary into a location in your $PATH .
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Update the docker-compose binaries permissions.
sudo chgrp docker /usr/local/bin/docker-compose
sudo chmod 750 /usr/local/bin/docker-compose
Confirm that you can run docker-compose commands.
docker-compose --version
# Output
docker-compose version 1.27.4, build 40524192
This post covered the process of installing Docker engine and Docker compose on Centos 8 Minimal.
https://docs.docker.com/engine/install/centos/
https://docs.docker.com/engine/install/linux-postinstall/
https://docs.docker.com/compose/install/
https://linuxconfig.org/how-to-install-docker-in-rhel-8
https://www.linuxtechi.com/install-docker-ce-centos-8-rhel-8/
https://stackoverflow.com/questions/59265190/permission-denied-in-docker-compose-on-linux