[Ubuntu] Install docker-compose

To install Docker Compose on Ubuntu, you can follow these steps:

 

  1. Download the Docker Compose binaries:

    sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  2. Grant execute permission:

    sudo chmod +x /usr/local/bin/docker-compose
  3. Verify installation: Run the following command to verify that Docker Compose was installed correctly:

    docker-compose --version

    If all goes well, it should display the version number of Docker Compose installed.

Note: Depending on your system configuration, you may need to prepend the above command sudoto gain administrator privileges.

With that, you have successfully installed Docker Compose on Ubuntu. Hope to help you! If you have any other questions, please feel free to ask.

In the command given curl, -$(uname -s)-$(uname -m)is the section used to dynamically build the Docker Compose download link. Let's explain -$(uname -s)-$(uname -m)what it means:

  • $(uname -s): uname -sis a command to get the name of the current operating system. -sThe parameter means to get the system name (that is, the kernel name). For example, the kernel name of a Linux system is usually "Linux".

  • $(uname -m): uname -mis another command to get the processor architecture of the current operating system. -mThe parameter means to get the hardware name of the machine. For example, common processor architectures include "x86_64" (64-bit) and "i386" (32-bit).

If it is really not easy to download, go directly to the official website to download the package, which is the same:
 

 

 

Guess you like

Origin blog.csdn.net/Holenxr/article/details/131734005