

Here, we have created a sample docker-compose.yml file in which we add the following basic hello-world container based on the latest hello-world image: version: '2' This is a configuration file in which you will describe the container’s information such as services, port bindings, networks, environment variables, and volumes. Now, you need to create a docker-compose.yml file.

So first, create a new directory for setting up the docker-compose file. Test the installation of Docker Compose to verify that it is working correctly with docker containers. Use the following command for changing file permission: sudo chmod +x /usr/local/bin/docker-compose Step 4: Verify Docker Compose InstallationĬheck the installed docker-compose version to verify the installation by executing the following command: sudo docker-compose –version Once the binary file is downloaded, make this file executable by changing the permissions on a file. If you want to install another version instead current available then, substitute your version in place of 1.29.2.

This command will download the appropriate binary for your system and place it into the /usr/local/bin. So, download the docker-compose binary by using the following command: sudo curl -L “$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose Here, we are installing the 1.29.0 that is available with all its dependencies. Therefore, it is best practice to download the latest binary from the releases page. In most popular Linux distributions, Docker Compose may be included in their package managers but these are outdated. The Docker Compose binary can be directly downloaded from the Github project’s releases. So, install the curl command by using the following command: sudo dnf install -y curl Step 2: Download the Docker Compose Binary The curl command is required to download the docker-compose binaries from Github. To install the latest release of Docker Compose v2 on your system, verify the docker installation using this command:Īfter that, you need to perform the following steps. Installation steps of Docker compose on AlmaLinux/Rocky Linux 8

