moby: Inconsistencies between --entrypoint/--command for run, service create, service update
docker run uses --entrypoint to override the entrypoint of an image
docker service create currently doesn’t support setting entrypoint
docker service update supports overriding the image entrypoint with the --command flag
We should make these consistent. I believe after this (https://github.com/docker/swarmkit/pull/1092) swarmkit change the service.Command acts the same way as container.Entrypoint.
I think we should probably be using --entrypoint for both docker service create and docker service update despite the API using a different name for it.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (18 by maintainers)
@dnephin Could you please stop confusing
CmdandCommand? They are not the same thing.Cmdis added to anEntrypointupon execution, similarArgsin other systems.CommandreplacesEntrypoint.This is our only chance to fix this.
As a user, it makes much more sense to think “Oh, I just want to run a command” than “I want to run a command. O, whats an entrypoint? Do I need to override that? How does that work? O, okay, to run a command, I need to override entrypoint, whatever that is”.
We can literally have this both ways, as entrypoint and command are now equivalent from a container perspective. And it is even better: we now have language to differentiate between an image’s entrypoint and running a command in a container that bypasses the image’s entrypoint.