-
Notifications
You must be signed in to change notification settings - Fork 644
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
run.cmd - support explicit exec form #253
Comments
You are right, the command specified for We will include this in one of the next section, if you like to speed this up you could help us with a PR: Starting point is the RunConfiguration where the command should be switched over to Arguments, similar as in |
…md or entry point. Falling back onto the simple string splitting
I have created a branch with a draft implementation. Specifying arguments explicitly works like a charm: <env>
<BLAH>FOOE</BLAH>
</env>
<cmd>
<exec>
<arg>sh</arg>
<arg>-c</arg>
<arg>echo $BLAH</arg>
</exec>
</cmd> but switching the <image>
<name>debian:jessie</name>
<run>
<entrypoint>
<shell>/bin/echo</shell>
</entrypoint>
<cmd><shell>the shell way</shell></cmd>
<log>
<prefix>keep splitting by the spaces</prefix>
</log>
</run>
</image> I suggest decreasing the configuration clutter by allowing the "Inlined collection" notation for the explicit arguments: <run>
<entrypoint>
<arg>echo</arg>
</entrypoint>
<cmd>
<arg>inlined args</arg>
<arg>mean less clutter</arg>
</cmd>
</run> and default property for the Arguments bean to be the shell form: <run>
<entrypoint>echo</entrypoint>
<cmd>default string for simple commands</cmd>
</run>
I plan to ponder bit more on why doesn't plain string cmd/entrypoint work against the docker API, will then polish the branch (validation/tests) and create a pull request in a week time at worst. |
Pull request sent: #269 |
At the moment it is not possible to run a more complicated command on a container start, e.g.
docker run -it --rm busybox /bin/sh -c "while true; do echo Hello world; sleep 1; done"
as the cmd is split by spaces at ContainerCreateConfig.command, and the following configuration:produces container startup error
true;: line 1: syntax error: unterminated quoted string
.It would be nice to have an ability to specify the exec form of the command explicitly, e.g.
in line with recent changes to ENTRYPOINT/CMD
The text was updated successfully, but these errors were encountered: