docker_compose_exec.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. hidden: false
  18. experimental: false
  19. experimentalcli: false
  20. kubernetes: false
  21. swarm: false
  22. - option: env
  23. shorthand: e
  24. value_type: stringArray
  25. default_value: '[]'
  26. description: Set environment variables
  27. deprecated: false
  28. hidden: false
  29. experimental: false
  30. experimentalcli: false
  31. kubernetes: false
  32. swarm: false
  33. - option: index
  34. value_type: int
  35. default_value: "1"
  36. description: |
  37. index of the container if there are multiple instances of a service [default: 1].
  38. deprecated: false
  39. hidden: false
  40. experimental: false
  41. experimentalcli: false
  42. kubernetes: false
  43. swarm: false
  44. - option: interactive
  45. shorthand: i
  46. value_type: bool
  47. default_value: "true"
  48. description: Keep STDIN open even if not attached.
  49. deprecated: false
  50. hidden: true
  51. experimental: false
  52. experimentalcli: false
  53. kubernetes: false
  54. swarm: false
  55. - option: no-TTY
  56. shorthand: T
  57. value_type: bool
  58. default_value: "true"
  59. description: |
  60. Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY.
  61. deprecated: false
  62. hidden: false
  63. experimental: false
  64. experimentalcli: false
  65. kubernetes: false
  66. swarm: false
  67. - option: privileged
  68. value_type: bool
  69. default_value: "false"
  70. description: Give extended privileges to the process.
  71. deprecated: false
  72. hidden: false
  73. experimental: false
  74. experimentalcli: false
  75. kubernetes: false
  76. swarm: false
  77. - option: tty
  78. shorthand: t
  79. value_type: bool
  80. default_value: "true"
  81. description: Allocate a pseudo-TTY.
  82. deprecated: false
  83. hidden: true
  84. experimental: false
  85. experimentalcli: false
  86. kubernetes: false
  87. swarm: false
  88. - option: user
  89. shorthand: u
  90. value_type: string
  91. description: Run the command as this user.
  92. deprecated: false
  93. hidden: false
  94. experimental: false
  95. experimentalcli: false
  96. kubernetes: false
  97. swarm: false
  98. - option: workdir
  99. shorthand: w
  100. value_type: string
  101. description: Path to workdir directory for this command.
  102. deprecated: false
  103. hidden: false
  104. experimental: false
  105. experimentalcli: false
  106. kubernetes: false
  107. swarm: false
  108. deprecated: false
  109. experimental: false
  110. experimentalcli: false
  111. kubernetes: false
  112. swarm: false