Skip to content
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

Allow unset `--entrypoint` in `docker run` or `docker create` #23718

Merged
merged 2 commits into from Aug 8, 2016

Conversation

@yongtang
Copy link
Member

commented Jun 18, 2016

- What I did

This fix tries to address the issue raised in #23498 to allow unset --entrypoint in docker run or docker create.

- How I did it

This fix checks the flag --entrypoint and, in case --entrypoint= ("") is passed, unset the Entrypoint during the container run.

- How to verify it

Additional integration tests have been created to cover changes in this fix.

- Description for the changelog

Allow unset --entrypoint in docker run or docker create by passing --entrypoint=.

- A picture of a cute animal (not mandatory but encouraged)

This fix fixes #23498.

Signed-off-by: Yong Tang yong.tang.github@outlook.com

@tonistiigi

This comment has been minimized.

Copy link
Member

commented Jun 19, 2016

design LGTM

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Jun 19, 2016

Yes, looks good

@LK4D4

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2016

@yongtang would you mind to rebase?

@yongtang

This comment has been minimized.

Copy link
Member Author

commented Aug 5, 2016

@LK4D4 Sure let me rebase it shortly. 😃

@yongtang yongtang force-pushed the yongtang:23498-entrypoint-unset branch from 01d3b2d to ef6506f Aug 5, 2016

@yongtang

This comment has been minimized.

Copy link
Member Author

commented Aug 5, 2016

@LK4D4 Rebased. Thanks.

@vdemeester

This comment has been minimized.

Copy link
Member

commented Aug 5, 2016

LGTM 🐸
This is gonna need updates in docs too 👼

@tonistiigi

This comment has been minimized.

Copy link
Member

commented Aug 5, 2016

LGTM

@yongtang

This comment has been minimized.

Copy link
Member Author

commented Aug 5, 2016

@tonistiigi @vdemeester @LK4D4 @thaJeztah The pull request has been updated with docs in docs/reference/api/docker_remote_api_v1.25.md and docs/reference/run.md. Please take a look and let me know if there are any issues.

@@ -1308,6 +1308,10 @@ or two examples of how to pass more parameters to that ENTRYPOINT:
> **Note**: Passing `--entrypoint` will clear out any default command set on the
> image (i.e. any `CMD` instruction in the Dockerfile used to build it).
> **Note**: Passing `--entrypoint=""` (empty string) will reset the entry
> point to system default (i.e., the entry point used by docker when there
> is no `ENTRYPOINT` instruction in the Dockerfile).

This comment has been minimized.

Copy link
@thaJeztah

thaJeztah Aug 5, 2016

Member

I don't think this should be a note (as it's not an "unexpected" behavior) perhaps similar to the flag description;

You can reset a containers entrypoint by passing an empty string, for example:

     $ docker run -it --entrypoint="" mysql bash

(and move that above the **Note**)

This comment has been minimized.

Copy link
@thaJeztah

thaJeztah Aug 5, 2016

Member

Wondering; I'm not at my computer now, but does resetting the entrypoint also reset the CMD (the same as setting a custom entrypoint?)

If so, I think we should have a test case for that

This comment has been minimized.

Copy link
@yongtang

yongtang Aug 5, 2016

Author Member

Thanks @thaJeztah. The pull request has been updated with the documentation change (like a flag description).

Resetting the entrypoint will also reset CMD. I adds an additional test case for that. Please let me know if there are any issues.

yongtang added 2 commits Jun 18, 2016
Allow unset `--entrypoint` in `docker run` or `docker create`
This fix tries to address the issue raised in #23498 to allow unset
`--entrypoint` in `docker run` or `docker create`.

This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`)
is passed, unset the Entrypoint during the container run.

Additional integration tests have been created to cover changes in this fix.

This fix fixes #23498.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Update documentation for entrypoint unset with `docker run/create`
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

@yongtang yongtang force-pushed the yongtang:23498-entrypoint-unset branch from 3979d52 to 26c913c Aug 5, 2016

@vdemeester

This comment has been minimized.

Copy link
Member

commented Aug 6, 2016

LGTM 🐸

@thaJeztah thaJeztah added this to the 1.13.0 milestone Aug 8, 2016

@thaJeztah

This comment has been minimized.

Copy link
Member

commented Aug 8, 2016

LGTM, thanks!

@thaJeztah thaJeztah merged commit 2684459 into moby:master Aug 8, 2016

8 checks passed

docker/dco-signed All commits signed
Details
documentation success
Details
experimental Jenkins build Docker-PRs-experimental 22089 has succeeded
Details
gccgo Jenkins build Docker-PRs-gccgo 8696 has succeeded
Details
janky Jenkins build Docker-PRs 30754 has succeeded
Details
userns Jenkins build Docker-PRs-userns 12776 has succeeded
Details
win2lin Jenkins build Docker-PRs-Win2Lin 29344 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 1423 has succeeded
Details

@yongtang yongtang deleted the yongtang:23498-entrypoint-unset branch Aug 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.