-
Notifications
You must be signed in to change notification settings - Fork 522
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
Use recommended EXEC form of commands #2172
Conversation
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) |
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.
LGTM. Consider changing the "Other" case too for consistency; it seems to be working as expected.
Weird, I did exactly what you're doing and it did not work for me. I'll try again. |
Yup, this time it's working. shrug |
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.