Use recommended EXEC form of commands#2172
Merged
bwateratmsft merged 5 commits intomasterfrom Jul 17, 2020
Merged
Conversation
Contributor
|
Regarding the "Other" Dockerfile, the EXEC form works for me: FROM docker/whalesay:latest
LABEL Name=scaffold Version=0.0.1
RUN apt-get -y update && apt-get install -y fortunes
CMD ["sh", "-c", "/usr/games/fortune -a | cowsay"]$ docker run --rm -it scaffold:latest
______________________________________
/ "Intelligence without character is a \
| dangerous thing." |
| |
\ -- G. Steinem /
--------------------------------------
\
\
\
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/ (tried on a Mac) |
karolz-ms
approved these changes
Jul 17, 2020
Contributor
karolz-ms
left a comment
There was a problem hiding this comment.
LGTM. Consider changing the "Other" case too for consistency; it seems to be working as expected.
Collaborator
Author
Weird, I did exactly what you're doing and it did not work for me. I'll try again. |
Collaborator
Author
Yup, this time it's working. shrug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2090
NOTE: the "Other" scaffolding still uses the other form (
CMD /usr/games/fortune -a | cowsay). I don't think there's value in changing that for two reasons--sh,-c. It is supposed to output a random bit of text (the output from/usr/games/fortune) and put it into a text box being spoken by the Docker whale (the pipe intocowsay). If the EXEC form is used, nothing is output to the terminal doing thedocker run; instead the output is just into the container itself.