![]() There are several different versions of the Compose file format with support for specific Docker releases. – The first line specifies the Compose file version. In this section, we’ll show how to use Docker Compose to run a Nginx container and expose it on your host machine.Ġ1- Create a new directory named nginx and move into it: $ mkdir ~/nginx & cd ~/nginxĠ2- Next, create docker-compose.yml file in your new directory and add the following lines: $ vi docker-compose.yml Step 2 – Getting started with Docker Compose In order to get the latest release of Docker Compose, go to the Docker’s GitHub repository site.Ġ1- Start by downloading the Docker Compose binary into the /usr/local/bin directory using the following curl command: $ sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composeĠ2- Next, set the permissions to make the binary executable: $ sudo chmod +x /usr/local/bin/docker-composeĠ3- Then, verify that the installation was successful by checking the version: $ sudo docker-compose -versionĭocker-compose version 1.25.4, build 4667896bĠ4- Furthermore, to run Compose as a non-root user, add your user to the docker group as below. Follow our previous tutorial about How to Install Docker on CentOS 8 Step 1 - Install Docker Compose On CentOS 8 – Logged in as a user with sudo privileges. ![]() ![]() Make sure that you have met the following prerequisites before continuing with this tutorial:
0 Comments
Leave a Reply. |