1
0

docker_compose.yaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. command: docker compose
  2. short: Docker Compose
  3. long: "You can use compose subcommand, `docker compose [-f <arg>...] [options] [COMMAND]
  4. [ARGS...]`, to build and manage\nmultiple services in Docker containers.\n\n###
  5. Use `-f` to specify name and path of one or more Compose files\nUse the `-f` flag
  6. to specify the location of a Compose configuration file.\n\n#### Specifying multiple
  7. Compose files\nYou can supply multiple `-f` configuration files. When you supply
  8. multiple files, Compose combines them into a single \nconfiguration. Compose builds
  9. the configuration in the order you supply the files. Subsequent files override
  10. and add \nto their predecessors.\n\nFor example, consider this command line:\n\n```\n$
  11. docker-compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db\n```\nThe
  12. `docker-compose.yml` file might specify a `webapp` service.\n\n```yaml\nservices:\n
  13. \ webapp:\n image: examples/web\n ports:\n - \"8000:8000\"\n volumes:\n
  14. \ - \"/data\"\n```\nIf the `docker-compose.admin.yml` also specifies this
  15. same service, any matching fields override the previous file. \nNew values, add
  16. to the `webapp` service configuration.\n\n```yaml\nservices:\n webapp:\n build:
  17. .\n environment:\n - DEBUG=1\n```\n\nWhen you use multiple Compose files,
  18. all paths in the files are relative to the first configuration file specified
  19. \nwith `-f`. You can use the `--project-directory` option to override this base
  20. path.\n\nUse a `-f` with `-` (dash) as the filename to read the configuration
  21. from stdin. When stdin is used all paths in the \nconfiguration are relative to
  22. the current working directory.\n\nThe `-f` flag is optional. If you don’t provide
  23. this flag on the command line, Compose traverses the working directory \nand its
  24. parent directories looking for a `compose.yaml` or `docker-compose.yaml` file.\n\n####
  25. Specifying a path to a single Compose file\nYou can use the `-f` flag to specify
  26. a path to a Compose file that is not located in the current directory, either
  27. \nfrom the command line or by setting up a `COMPOSE_FILE` environment variable
  28. in your shell or in an environment file.\n\nFor an example of using the `-f` option
  29. at the command line, suppose you are running the Compose Rails sample, and \nhave
  30. a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command
  31. like `docker compose pull` to \nget the postgres image for the db service from
  32. anywhere by using the `-f` flag as follows: \n```\ndocker compose -f ~/sandbox/rails/compose.yaml
  33. pull db\n```\n\n### Use `-p` to specify a project name\n\nEach configuration has
  34. a project name. If you supply a `-p` flag, you can specify a project name. If
  35. you don’t \nspecify the flag, Compose uses the current directory name. \nProject
  36. name can also be set by `COMPOSE_PROJECT_NAME` environment variable.\n\nMost compose
  37. subcommand can be ran without a compose file, just passing \nproject name to retrieve
  38. the relevant resources.\n\n```\n$ docker compose -p my_project ps -a\nNAME SERVICE
  39. \ STATUS PORTS\nmy_project_demo_1 demo running \n\n$
  40. docker compose -p my_project logs\ndemo_1 | PING localhost (127.0.0.1): 56 data
  41. bytes\ndemo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms\n```\n\n###
  42. Use profiles to enable optional services\n\nUse `--profile` to specify one or
  43. more active profiles\nCalling `docker compose --profile frontend up` will start
  44. the services with the profile `frontend` and services \nwithout any specified
  45. profiles. \nYou can also enable multiple profiles, e.g. with `docker compose --profile
  46. frontend --profile debug up` the profiles `frontend` and `debug` will be enabled.\n\nProfiles
  47. can also be set by `COMPOSE_PROFILES` environment variable.\n\n### Set up environment
  48. variables\n\nYou can set environment variables for various docker-compose options,
  49. including the `-f`, `-p` and `--profiles` flags.\n\nSetting the `COMPOSE_FILE`
  50. environment variable is equivalent to passing the `-f` flag,\n`COMPOSE_PROJECT_NAME`
  51. environment variable does the same for to the `-p` flag,\nand so does `COMPOSE_PROFILES`
  52. environment variable for to the `--profiles` flag.\n\nIf flags are explicitly
  53. set on command line, associated environment variable is ignored"
  54. usage: docker compose
  55. pname: docker
  56. plink: docker.yaml
  57. cname:
  58. - docker compose build
  59. - docker compose convert
  60. - docker compose cp
  61. - docker compose create
  62. - docker compose down
  63. - docker compose events
  64. - docker compose exec
  65. - docker compose images
  66. - docker compose kill
  67. - docker compose logs
  68. - docker compose ls
  69. - docker compose pause
  70. - docker compose port
  71. - docker compose ps
  72. - docker compose pull
  73. - docker compose push
  74. - docker compose restart
  75. - docker compose rm
  76. - docker compose run
  77. - docker compose start
  78. - docker compose stop
  79. - docker compose top
  80. - docker compose unpause
  81. - docker compose up
  82. clink:
  83. - docker_compose_build.yaml
  84. - docker_compose_convert.yaml
  85. - docker_compose_cp.yaml
  86. - docker_compose_create.yaml
  87. - docker_compose_down.yaml
  88. - docker_compose_events.yaml
  89. - docker_compose_exec.yaml
  90. - docker_compose_images.yaml
  91. - docker_compose_kill.yaml
  92. - docker_compose_logs.yaml
  93. - docker_compose_ls.yaml
  94. - docker_compose_pause.yaml
  95. - docker_compose_port.yaml
  96. - docker_compose_ps.yaml
  97. - docker_compose_pull.yaml
  98. - docker_compose_push.yaml
  99. - docker_compose_restart.yaml
  100. - docker_compose_rm.yaml
  101. - docker_compose_run.yaml
  102. - docker_compose_start.yaml
  103. - docker_compose_stop.yaml
  104. - docker_compose_top.yaml
  105. - docker_compose_unpause.yaml
  106. - docker_compose_up.yaml
  107. options:
  108. - option: ansi
  109. value_type: string
  110. default_value: auto
  111. description: |
  112. Control when to print ANSI control characters ("never"|"always"|"auto")
  113. deprecated: false
  114. experimental: false
  115. experimentalcli: false
  116. kubernetes: false
  117. swarm: false
  118. - option: env-file
  119. value_type: string
  120. description: Specify an alternate environment file.
  121. deprecated: false
  122. experimental: false
  123. experimentalcli: false
  124. kubernetes: false
  125. swarm: false
  126. - option: file
  127. shorthand: f
  128. value_type: stringArray
  129. default_value: '[]'
  130. description: Compose configuration files
  131. deprecated: false
  132. experimental: false
  133. experimentalcli: false
  134. kubernetes: false
  135. swarm: false
  136. - option: no-ansi
  137. value_type: bool
  138. default_value: "false"
  139. description: Do not print ANSI control characters (DEPRECATED)
  140. deprecated: false
  141. experimental: false
  142. experimentalcli: false
  143. kubernetes: false
  144. swarm: false
  145. - option: profile
  146. value_type: stringArray
  147. default_value: '[]'
  148. description: Specify a profile to enable
  149. deprecated: false
  150. experimental: false
  151. experimentalcli: false
  152. kubernetes: false
  153. swarm: false
  154. - option: project-directory
  155. value_type: string
  156. description: |-
  157. Specify an alternate working directory
  158. (default: the path of the Compose file)
  159. deprecated: false
  160. experimental: false
  161. experimentalcli: false
  162. kubernetes: false
  163. swarm: false
  164. - option: project-name
  165. shorthand: p
  166. value_type: string
  167. description: Project name
  168. deprecated: false
  169. experimental: false
  170. experimentalcli: false
  171. kubernetes: false
  172. swarm: false
  173. - option: workdir
  174. value_type: string
  175. description: |-
  176. DEPRECATED! USE --project-directory INSTEAD.
  177. Specify an alternate working directory
  178. (default: the path of the Compose file)
  179. deprecated: false
  180. experimental: false
  181. experimentalcli: false
  182. kubernetes: false
  183. swarm: false
  184. deprecated: false
  185. experimental: false
  186. experimentalcli: false
  187. kubernetes: false
  188. swarm: false