Docker Compose 安装

Docker Compose 用来批量管理 Docker容器
官方文档 https://docs.docker.com/compose/install/

注意,CentOS 6.x 上就算安装成功了也不能使用,因为Docker Compose需要Docker engine版本
为1.10 以上,而 CentOS6 上最多能装 1.7版本。
所以以下文档看看就算了。。。

  • Mac 与 Windows 上的 docker 已经自带了 Compose

  • CentOS 6.x 安装 Docker Compose

  • 打开 URL

    官方发布的版本中有安装方法,打开以下地址,从最新版本中复制

    https://github.com/docker/compose/releases

    1
    2
    3
    4
    5
    6
    7
    8
    9
    If you're a Mac or Windows user, the best way to install Compose and keep it up-to-date is Docker for Mac and Windows.

    Note that Compose 1.10.0-rc2 requires Docker Engine 1.10.0 or later for version 2 of the Compose File format, and Docker Engine 1.9.1 or later for version 1. Docker for Mac and Windows will automatically install the latest version of Docker Engine for you.

    Alternatively, you can use the usual commands to install or upgrade Compose:

    curl -L https://github.com/docker/compose/releases/download/1.10.0-rc2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
    See the install docs for more install options and instructions.

    所以是执行

    1
    2
    curl -L https://github.com/docker/compose/releases/download/1.10.0-rc2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
  • 添加权限

    1
    chmod +x /usr/local/bin/docker-compose
  • 确认完成

    1
    docker-compose --version
  • 如果以上安装不成功,可以使用 pip 进行安装

    1
    pip install docker-compose