Total Pageviews

Sunday, 25 September 2016

如何安装 docker-compose

wget https://github.com/docker/compose/releases/download/1.8.1/docker-compose-Linux-x86_64
cp docker-compose-Linux-x86_64 /usr/local/bin/docker-compose


发布的二进制包可以在 https://github.com/docker/compose/releases 找到。

下载后直接放到执行路径即可。


root@shc:~# docker-compose version
docker-compose version 1.8.1, build 878cff1
docker-py version: 1.10.3
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
root@shc:~# 

项目地址:https://github.com/docker/compose/
------
另一种安装方法:用PIP安装。

执行命令:
$ sudo pip install -U docker-compose
安装成功后,可以查看 docker-compose 命令的用法。
$ docker-compose -h
Fast, isolated development environments using Docker.

Usage:
  docker-compose [options] [COMMAND] [ARGS...]
  docker-compose -h|--help

Options:
  --verbose                 Show more output
  --version                 Print version and exit
  -f, --file FILE           Specify an alternate compose file (default: docker-compose.yml)
  -p, --project-name NAME   Specify an alternate project name (default: directory name)

Commands:
  build     Build or rebuild services
  help      Get help on a command
  kill      Kill containers
  logs      View output from containers
  port      Print the public port for a port binding
  ps        List containers
  pull      Pulls service images
  rm        Remove stopped containers
  run       Run a one-off command
  scale     Set number of containers for a service
  start     Start services
  stop      Stop services
  restart   Restart services
  up        Create and start containers
from https://yeasy.gitbooks.io/docker_practice/content/compose/install.html,
https://yeasy.gitbooks.io/docker_practice/content/compose/usage.html
https://yeasy.gitbooks.io/docker_practice/content/compose/commands.html
https://yeasy.gitbooks.io/docker_practice/content/compose/yaml_file.html