For the below "shell" form of RUN instruction, what would be the "exec" form?
RUN echo `uname -rv` > $HOME/kernel-info
I tried below, its giving the error, cat: can't open '/root/kernel-info': No such file or directory
RUN ["echo","uname", "-rv", ">", "$HOME","/kernel-info" ]
2
Answers
To use a different shell, other than
/bin/sh
, use the exec form passing in the desired shell. For example:You’re using output redirection and environment variable substitution which are both done by the shell. So you need a shell to run. If you prefer the exec form, you need to run the shell yourself, like this