今回は、Docker composeのご紹介をします!

Define and run multi-container applications with Docker.
# Dockerとマルチコンテナアプリを定義し実行します。

  docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
  docker-compose -h|--help

  -f, --file FILE             Specify an alternate compose file (default: docker-compose.yml)
  -p, --project-name NAME     Specify an alternate project name (default: directory name)
  --verbose                   Show more output
  -v, --version               Print version and exit
  #docker composeのバージョン
  -H, --host HOST             Daemon socket to connect to

  --tls                       Use TLS; implied by --tlsverify
  --tlscacert CA_PATH         Trust certs signed only by this CA
  --tlscert CLIENT_CERT_PATH  Path to TLS certificate file
  --tlskey TLS_KEY_PATH       Path to TLS key file
  --tlsverify                 Use TLS and verify the remote
  --skip-hostname-check       Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address)
  --project-directory PATH    Specify an alternate working directory
                              (default: the path of the compose file)

  build              Build or rebuild services
  bundle             Generate a Docker bundle from the Compose file
  config             Validate and view the compose file
  create             Create services
  down               Stop and remove containers, networks, images, and volumes
  events             Receive real time events from containers
  exec               Execute a command in a running container
  help               Get help on a command
  images             List images
  kill               Kill containers
  logs               View output from containers
  pause              Pause services
  port               Print the public port for a port binding
  ps                 List containers
  pull               Pull service images
  push               Push service images
  restart            Restart services
  rm                 Remove stopped containers
  run                Run a one-off command
  scale              Set number of containers for a service
  start              Start services
  stop               Stop services
  top                Display the running processes
  unpause            Unpause services
  up                 Create and start containers
  version            Show the Docker-Compose version information

使い方は、巷のblogを参考にしていただけばいいと思うだが、 簡単な流れは以下の通り

  1. docker-compose.ymlにリソースの塊を記述する
  2. ホストでdockerdでも何でもいいんだけど、container runtimeが動いていることを確認する。
  3. docker-compose.ymlとともにdocker-composeを実行する。


pub 4096R/102EFFB8 2017-04-02 Kyohei Moriyama (sasukeh)
Primary key fingerprint: 2BE2 1FA9 8F72 C692 1E37 6072 5440 EEBA 102E FFB8