DockerCompose 安装

Prerequisites

 

预备知识:

 

Docker Compose relies on Docker Engine for any meaningful work, so make sure you have Docker Engine installed either locally or remote, depending on your setup.

 

Docker Compose依赖Docker引擎完成任何有意义的工作,因此请确保根据您的设置在本地或远程安装Docker引擎。

 

On Linux systems, first install the Docker for your OS as described on the Get Docker page, then come back here for instructions on installing Compose on Linux systems.

 

在Linux系统上,首先按照Get Docker页面上的描述为您的操作系统安装Docker,然后回到这里获取关于在Linux系统上安装Compose的说明。

 

 

Install Docker compose on Linux System

在linux 系统安装docker compose

 

On Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub. Follow the instructions from the link, which involve running the curl command in your terminal to download the binaries. These step by step instructions are also included below.

 

在Linux上,您可以从GitHub上的撰写存储库发布页面下载Docker撰写二进制文件。按照链接中的说明操作,其中包括在终端中运行curl命令下载二进制文件。下面还包括这些逐步说明。

 

Run this command to download the latest version

运行此命令下载最新版本

 

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose

 

注:检查最新版本地址:https://github.com/docker/compose/releases

 

2、Apply executable permissions to the binary:

对二进制文件应用可执行权限:

 

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

 

3、Optionally, install command completion for the bash and zsh shell.

 

另外,还可以为bash和zsh shell安装命令完成。

 

  1. Test the installation.

验证安装

$ docker-compose --version

 

 

Master builds

Master 分支构建

 

If you’re interested in trying out a pre-release build, you can download a binary from https://dl.bintray.com/docker-compose/master/. Pre-release builds allow you to try out new features before they are released, but may be less stable.

 

如果您对试用预发布版本感兴趣,可以从https://dl.bintray.com/docker.compose/master/下载二进制文件。预发布版本允许您在新特性发布之前尝试它们,但是可能不太稳定。

 

Updating

更新

If you’re upgrading from Compose 1.2 or earlier, remove or migrate your existing containers after upgrading Compose. This is because, as of version 1.3, Compose uses Docker labels to keep track of containers, and your containers need to be recreated to add the labels.

 

如果您正在从Compse 1.2或更早版本升级,请在升级组合之后删除或迁移现有容器。这是因为,在1.3版本中,Compose使用Docker标签来跟踪容器,需要重新创建容器来添加标签。

 

If Compose detects containers that were created without labels, it refuses to run so that you don’t end up with two sets of them. If you want to keep using your existing containers (for example, because they have data volumes you want to preserve), you can use Compose 1.5.x to migrate them with the following command:

 

如果Compose检测到没有标签创建的容器,它将拒绝运行,这样您就不会得到两组容器。如果您希望继续使用现有容器(例如,因为它们具有您希望保存的数据量),可以使用组合1.5。x用以下命令迁移它们:

 

docker-compose migrate-to-labels

 

Alternatively, if you’re not worried about keeping them, you can remove them. Compose just creates new ones.

或者,如果您不担心保存它们,您可以删除它们。组合只是创建新的。

 

 

 

uninstallation

卸载

 

To uninstall Docker Compose if you installed using curl :

 

要卸载Docker Compose,如果你安装使用CURL。

 

sudo rm /usr/local/bin/docker-compose

 

To uninstall Docker Compose if you installed using pip:

要卸载Docker Compose,如果你安装使用pip:

 

pip uninstall docker-compose

你可能感兴趣的:(Docker,官方文档翻译,Docker,Compose)