Skip to content

Commit 12a727d

Browse files
committed
edit
1 parent c7629bd commit 12a727d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

content/reference/compose-file/services.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,13 @@ command: bundle exec thin -p 3000
259259

260260
> [!NOTE]
261261
>
262-
> Unlike the `CMD` instruction of an image, the [shell-form syntax](https://docs.docker.com/reference/dockerfile/#shell-form) for `command`
263-
> does not implicitly run in the context of the [`SHELL` instruction](https://docs.docker.com/reference/dockerfile/#shell).
264-
>
265-
> If you expect the command to rely on features of a shell environment such as environment variables, then ensure the command is run within a shell:
262+
> Unlike the `CMD` instruction in a Dockerfile, the `command` field doesn't automatically run within the context of the [`SHELL`](/reference/dockerfile/#shell-form) instruction defined in the image. If your `command` relies shell-specific features, such as environment variable expansion, you need to explicitly run it within a shell. For example:
266263
>
267264
> ```yaml
268265
> command: /bin/sh -c 'echo "hello $$HOSTNAME"'
269266
> ```
270267
>
271-
> When the `entrypoint` (or image `ENTRYPOINT`) is configured to run the shell instead, to ensure `command` is processed correctly you should use the exec-form described bellow.
268+
>If the `entrypoint`, (or the image's `ENTRYPOINT`) is configured to invoke a shell, use the exec form syntax for `command` to ensure proper processing.
272269

273270
The value can also be a list, in a manner similar to the [exec-form syntax](/reference/dockerfile.md#exec-form) used by the [Dockerfile](/reference/dockerfile.md#cmd):
274271

0 commit comments

Comments
 (0)