Docker installation
On CentOS 7, you can install the stable version of Docker from its repository using Yum. Follow the instructions below.
- Run this command to install the stable version of Docker for CentOS 7:
sudo yum install docker-latest
- Add docker group:
sudo groupadd docker
- After installation has been done , start docker service using systemctl:
sudo systemctl enable docker-latest
- Start Docker service:
sudo systemctl start docker-latest
- Add current user to the docker group:
sudo usermod --groups docker user
- Test the installation:
$ docker --version
Docker version 1.13.1, build 64857f9
Docker Compose Installation
You can download the Docker Compose binary from the Compose repository release page on GitHub (https://github.com/docker/compose/releases). Follow the instructions from the link, which involve running the curl command in your terminal to download the binaries. These step by step instructions are also included below.
Run this command to download the latest version of Docker Compose:
sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s-uname -m` -o /usr/local/bin/docker-compose
Use the latest Compose release number in the download command. The above command is an example, and it may become out-of-date. To ensure you have the latest version, check the Compose repository release page on GitHub.
- Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
- Test the installation:
$ docker-compose --version
docker-compose version 1.17.0, build 1719ceb