docker_compose.yaml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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\n### Use
  37. profiles to enable optional services\n\nUse `--profile` to specify one or more
  38. active profiles\nCalling `docker compose --profile frontend up` will start the
  39. services with the profile `frontend` and services \nwithout any specified profiles.
  40. \nYou can also enable multiple profiles, e.g. with `docker compose --profile frontend
  41. --profile debug up` the profiles `frontend` and `debug` will be enabled.\n\nProfiles
  42. can also be set by `COMPOSE_PROFILES` environment variable.\n\n### Set up environment
  43. variables\n\nYou can set environment variables for various docker-compose options,
  44. including the `-f`, `-p` and `--profiles` flags.\n\nSetting the `COMPOSE_FILE`
  45. environment variable is equivalent to passing the `-f` flag,\n`COMPOSE_PROJECT_NAME`
  46. environment variable does the same for to the `-p` flag,\nand so does `COMPOSE_PROFILES`
  47. environment variable for to the `--profiles` flag.\n\nIf flags are explicitly
  48. set on command line, associated environment variable is ignored"
  49. pname: docker
  50. plink: docker.yaml
  51. cname:
  52. - docker compose build
  53. - docker compose convert
  54. - docker compose create
  55. - docker compose down
  56. - docker compose events
  57. - docker compose exec
  58. - docker compose kill
  59. - docker compose logs
  60. - docker compose ls
  61. - docker compose pause
  62. - docker compose ps
  63. - docker compose pull
  64. - docker compose push
  65. - docker compose rm
  66. - docker compose run
  67. - docker compose start
  68. - docker compose stop
  69. - docker compose top
  70. - docker compose unpause
  71. - docker compose up
  72. clink:
  73. - docker_compose_build.yaml
  74. - docker_compose_convert.yaml
  75. - docker_compose_create.yaml
  76. - docker_compose_down.yaml
  77. - docker_compose_events.yaml
  78. - docker_compose_exec.yaml
  79. - docker_compose_kill.yaml
  80. - docker_compose_logs.yaml
  81. - docker_compose_ls.yaml
  82. - docker_compose_pause.yaml
  83. - docker_compose_ps.yaml
  84. - docker_compose_pull.yaml
  85. - docker_compose_push.yaml
  86. - docker_compose_rm.yaml
  87. - docker_compose_run.yaml
  88. - docker_compose_start.yaml
  89. - docker_compose_stop.yaml
  90. - docker_compose_top.yaml
  91. - docker_compose_unpause.yaml
  92. - docker_compose_up.yaml
  93. options:
  94. - option: ansi
  95. value_type: string
  96. default_value: auto
  97. description: |
  98. Control when to print ANSI control characters ("never"|"always"|"auto")
  99. deprecated: false
  100. experimental: false
  101. experimentalcli: false
  102. kubernetes: false
  103. swarm: false
  104. - option: env-file
  105. value_type: string
  106. description: Specify an alternate environment file.
  107. deprecated: false
  108. experimental: false
  109. experimentalcli: false
  110. kubernetes: false
  111. swarm: false
  112. - option: file
  113. shorthand: f
  114. value_type: stringArray
  115. default_value: '[]'
  116. description: Compose configuration files
  117. deprecated: false
  118. experimental: false
  119. experimentalcli: false
  120. kubernetes: false
  121. swarm: false
  122. - option: profile
  123. value_type: stringArray
  124. default_value: '[]'
  125. description: Specify a profile to enable
  126. deprecated: false
  127. experimental: false
  128. experimentalcli: false
  129. kubernetes: false
  130. swarm: false
  131. - option: project-directory
  132. value_type: string
  133. description: |-
  134. Specify an alternate working directory
  135. (default: the path of the Compose file)
  136. deprecated: false
  137. experimental: false
  138. experimentalcli: false
  139. kubernetes: false
  140. swarm: false
  141. - option: project-name
  142. shorthand: p
  143. value_type: string
  144. description: Project name
  145. deprecated: false
  146. experimental: false
  147. experimentalcli: false
  148. kubernetes: false
  149. swarm: false
  150. - option: workdir
  151. value_type: string
  152. description: |-
  153. DEPRECATED! USE --project-directory INSTEAD.
  154. Specify an alternate working directory
  155. (default: the path of the Compose file)
  156. deprecated: false
  157. experimental: false
  158. experimentalcli: false
  159. kubernetes: false
  160. swarm: false
  161. deprecated: false
  162. experimental: false
  163. experimentalcli: false
  164. kubernetes: false
  165. swarm: false