0. What is docker?
Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.
https://docs.docker.com/get-started/overview/
1. Installing Docker CE
Reference: Install Docker Engine | Docker Docs
1.1. Remove old versions (if any exists)
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
1.2. Set up the repository and install Docker Engine
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
1.3. Start Docker and test if it works
sudo systemctl start docker
sudo docker run hello-world
1.4. Adding user to docker group
You may need to log out and in again to take this change affect.
sudo usermod -aG docker your_user_name_here
2. Installing Docker-compose
Reference: Overview of installing Docker Compose | Docker Docs
2.1. Download current stable version of Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2.2. Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
2.3. Test if it works and prints version
docker-compose --version