![]() ![]() In the second section of services, we are are going to define a service called web. For full details, check Compose and Docker compatibility matrix. 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 and Use Docker CE on Linux Logged in as a user with sudo privileges. ![]() Make sure that you have met the following prerequisites before continuing with this tutorial: In this tutorial, we’ll show you how to install the latest version of Docker Compose on CentOS/ RHEL or Ubuntu 16.04/ Ubuntu 18.04 and explore the basic Docker Compose concepts and commands. Then, with a single command, you create and start all the services from your configuration. With Docker Compose, you use a YAML file to configure your application’s services. Docker Compose is a tool for defining and running multi-container Docker applications.
0 Comments
Leave a Reply. |