You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike the shell form, the exec form does not invoke a command shell. This means that normal shell processing does not happen. For example, CMD [ "echo", "$HOME" ] will not do variable substitution on $HOME.
the documentation mentions this work-around:
If you want shell processing then either use the shell form or execute a shell directly, for example: CMD [ "sh", "-c", "echo", "$HOME" ].
but this is not correct, the documentation is wrong, in order for environment variable interpolation to work in exec form, in the CMD, it must be structured like this: CMD [ "sh", "-c", "echo $HOME" ]
but this cannot be achieved through the plugin because <command>sh -c echo $ENV_VAR</command> results in CMD [ "sh", "-c", "echo", "$ENV_VAR" ] which is broken whereas we want CMD [ "sh", "-c", "echo $ENV_VAR" ] which is the desired result
The conversion of <command> to a JSON array (exec form) should be disabled.
The text was updated successfully, but these errors were encountered:
alan-czajkowski
changed the title
Stop <command> from converting CMD to "exec form"
Stop <command> from converting CMD to "exec form" (JSON array)
Apr 28, 2015
The following does not work:
because
<command>
is converted to a JSON array (exec form), and according the documentation http://docs.docker.com/reference/builder/#cmdthe documentation mentions this work-around:
but this is not correct, the documentation is wrong, in order for environment variable interpolation to work in exec form, in the
CMD
, it must be structured like this:CMD [ "sh", "-c", "echo $HOME" ]
but this cannot be achieved through the plugin because
<command>sh -c echo $ENV_VAR</command>
results inCMD [ "sh", "-c", "echo", "$ENV_VAR" ]
which is broken whereas we wantCMD [ "sh", "-c", "echo $ENV_VAR" ]
which is the desired resultThe conversion of
<command>
to a JSON array (exec form) should be disabled.The text was updated successfully, but these errors were encountered: