-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENGDOCS-2382 #21848
base: main
Are you sure you want to change the base?
ENGDOCS-2382 #21848
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with the difference of this document file vs the related PR but you may want to ensure they're in sync? The content is diverging here (and also incorrect in advice).
> 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. For example: | ||
> | ||
> ```yaml | ||
> command: [ "bundle", "exec", "thin", "-p", "3000" ] | ||
> ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be incorrect.
If the image/container has ENTRYPOINT ["/bin/sh", "-c"]
set, then command
should be a string value for providing to -c
, thus you would need:
# Compose will also treat entrypoint config like below as if it were `ENTRYPOINT ["/bin/sh", "-c"]`:
entrypoint: /bin/sh -c
command: ["bundle exec thin -p 3000"]
# or
command: "'bundle exec thin -p 3000'"
# or
command: |
'bundle exec thin -p 3000'
When the image has no entrypoint to run, the equivalent command only form of this is:
command: /bin/sh -c 'bundle exec thin -p 3000'
# or
command: ["/bin/sh", "-c", "bundle exec thin -p 3000"]
# or (because no shell environment is actually needed), either of these:
command: bundle exec thin -p 3000
command: [ "bundle", "exec", "thin", "-p", "3000" ]
The exec-form / YAML list style is less ambiguous with how Compose will segment the value into exec-form, it technically doesn't have shell-form (only really exists for Dockerfile
).
As you can see above, it would be good for the documentation to communicate this (or the value in preferring YAML list style which is clearer in how it'll be handled).
It took a while for me to experiment and grok what was going on: docker/compose#12403 (comment) thus it'd be good if other users could avoid repeating that with the docs providing clear guidance/insight.
Description
Adds info in compose-spec/compose-spec#557
Related issues or tickets
Reviews