docker_compose_exec.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. command: docker compose exec
  2. short: Execute a command in a running container.
  3. long: |-
  4. This is the equivalent of `docker exec` targeting a Compose service.
  5. With this subcommand you can run arbitrary commands in your services. Commands are by default allocating a TTY, so
  6. you can use a command such as `docker compose exec web sh` to get an interactive prompt.
  7. usage: docker compose exec [options] [-e KEY=VAL...] [--] SERVICE COMMAND [ARGS...]
  8. pname: docker compose
  9. plink: docker_compose.yaml
  10. options:
  11. - option: detach
  12. shorthand: d
  13. value_type: bool
  14. default_value: "false"
  15. description: 'Detached mode: Run command in the background.'
  16. deprecated: false
  17. experimental: false
  18. experimentalcli: false
  19. kubernetes: false
  20. swarm: false
  21. - option: env
  22. shorthand: e
  23. value_type: stringArray
  24. default_value: '[]'
  25. description: Set environment variables
  26. deprecated: false
  27. experimental: false
  28. experimentalcli: false
  29. kubernetes: false
  30. swarm: false
  31. - option: index
  32. value_type: int
  33. default_value: "1"
  34. description: |
  35. index of the container if there are multiple instances of a service [default: 1].
  36. deprecated: false
  37. experimental: false
  38. experimentalcli: false
  39. kubernetes: false
  40. swarm: false
  41. - option: no-TTY
  42. shorthand: T
  43. value_type: bool
  44. default_value: "false"
  45. description: |
  46. Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.
  47. deprecated: false
  48. experimental: false
  49. experimentalcli: false
  50. kubernetes: false
  51. swarm: false
  52. - option: privileged
  53. value_type: bool
  54. default_value: "false"
  55. description: Give extended privileges to the process.
  56. deprecated: false
  57. experimental: false
  58. experimentalcli: false
  59. kubernetes: false
  60. swarm: false
  61. - option: user
  62. shorthand: u
  63. value_type: string
  64. description: Run the command as this user.
  65. deprecated: false
  66. experimental: false
  67. experimentalcli: false
  68. kubernetes: false
  69. swarm: false
  70. - option: workdir
  71. shorthand: w
  72. value_type: string
  73. description: Path to workdir directory for this command.
  74. deprecated: false
  75. experimental: false
  76. experimentalcli: false
  77. kubernetes: false
  78. swarm: false
  79. deprecated: false
  80. experimental: false
  81. experimentalcli: false
  82. kubernetes: false
  83. swarm: false