如何在Ubuntu 20.04上安装Docker Compose [快速入门]

介绍 (Introduction)

In this quickstart guide, we’ll install Docker Compose on an Ubuntu 20.04 server.

在本快速入门指南中,我们将在Ubuntu 20.04服务器上安装Docker Compose 。

For a more detailed version of this tutorial, with more explanations of each step, please refer to How To Install and Use Docker Compose on Ubuntu 20.04.

有关本教程的更详细版本,以及每个步骤的更多说明,请参考如何在Ubuntu 20.04上安装和使用Docker Compose 。

先决条件 (Prerequisites)

To follow this guide, you’ll need access to an Ubuntu 20.04 server or local machine as a sudo user, and Docker installed on this system.

要遵循本指南,您需要以sudo用户身份访问Ubuntu 20.04服务器或本地计算机,并且需要在该系统上安装Docker。

第1步-下载Docker Compose (Step 1 — Download Docker Compose)

Start by confirming the most recent Docker Compose release available in their releases page. At the time of this writing, the most current stable version is 1.26.0.

首先在其发布页面中确认可用的最新Docker Compose版本。 在撰写本文时,最新的稳定版本是1.26.0

Run the following command to download Docker Compose and make this software globally accessible on your system as docker-compose:

运行以下命令以下载Docker Compose,并使该软件可以作为docker-compose在系统上全局访问:

  • sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

    sudo curl -L“ https://github.com/docker/compose/releases/download/ 1.26.0 / docker -compose-$(uname -s)-$(uname -m)” -o / usr / local / bin / docker-compose

步骤2 —设置可执行权限 (Step 2 — Set Up Executable Permissions)

Next, set the correct permissions to make sure the docker-compose command is executable:

接下来,设置正确的权限以确保docker-compose命令是可执行的:

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

    须藤chmod + x / usr / local / bin / docker-compose

To verify that the installation was successful, run:

要验证安装是否成功,请运行:

  • docker-compose --version

    docker-compose --version

You’ll see output similar to this:

您将看到类似于以下的输出:


   
     
     
     
     
Output
docker-compose version 1.26.0, build 8a1c60f6

Docker Compose is now successfully installed on your system.

Docker Compose现在已成功安装在您的系统上。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-20-04-quickstart

你可能感兴趣的:(docker,linux,ubuntu,java,python)