Docker installation

The first thing you need to do is install Docker and Docker compose if you don’t have them already.

Docker engine

Docker requires a 64-bit operating system running kernel version 3.10 or higher.

  1. Check your current kernel version. Open a terminal and use uname -r to display your kernel version:
# uname -r
3.10.0-229.el7.x86_64
  1. Run the Docker installation script.
# curl -sSL https://get.docker.com/ | sh

Note

If you would like to use Docker as a non-root user, you should now consider adding your user to the docker group with something like the following command (remember that you’ll have to log out and log back in for this to take effect):

# usermod -aG docker your-user

Docker compose

Docker Compose 1.6 or newer is required. Follow these steps to install it:

  1. Download the Docker Compose binary:
# curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  1. Grant execution permissions:
# chmod +x /usr/local/bin/docker-compose

Note

If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.

For example:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  1. Test the installation to ensure everything went properly:
$ docker-compose --version
docker-compose version 1.23.1, build b02f1306

Note

If you see docker-compose: command not found it means that /usr/local/bin is not in your PATH, most Linux distributions have /usr/bin in PATH so you can create a symbolic link from /usr/local/bin to /usr/bin.

# ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose