Docker Compose Installation

Docker compose is a tool to define and run multi-container docker applications, Users use this tool to launch, execute, communicate, and close containers with a single coordinated command. Here is step by step Docker Compose Installation,

Step 1, Update Repositories and Packages

Before starting any installation, make sure to update the software repositories and software packages.

  • sudo yum update

    sudo yum upgrade

  • In the next step, you will use the curl command to download the binaries for Docker Compose. Beforehand, check whether you have the required command-tool by typing,

    • curl

    • If you see curl: command not found, just the command below,

      • sudo yum install curl

      Step 2, Download Docker Compose

      In this step, the current stable release of Docker Compose is 1.28.0 , when you want to download please check the version here

      • sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

      • To change the file permissions to make the software executable,

        • sudo chmod +x /usr/local/bin/docker-compose

        • To make sure the process is successful, you can type,

          • docker-compose --version

          Docker Compose

          After you success to install docker-compose, Now first one, download the edit file here and after that you have to create a folder test-dockercompose and make dockerfile requirements for docker-compose, such as: Dockerfile , docker-compose.yml , , requirements.txt .

          First, edit Dockerfile,

          • gedit Dockerfile &

          Second, edit docker-compose.yml ,

          • gedit docker-compose.yml &

          Third, edit ,

          • gedit &

          Forth, edit requirements.txt ,

          • gedit requirements.txt &

          After all the dockerfile requirements for docker-compose are done, now you can start docker-compose

          • docker-compose up -d

          • You will the result by typing the command,

            • docker ps -a | grep test

            • Then you can go to the web page to test it to see the result.