Skip to content

Documenting ENTRYPOINT can empty value of CMD#1523

Merged
silvin-lubecki merged 1 commit intodocker:masterfrom
sudo-bmitch:pr-doc-cmd-entrypoint
Nov 20, 2018
Merged

Documenting ENTRYPOINT can empty value of CMD#1523
silvin-lubecki merged 1 commit intodocker:masterfrom
sudo-bmitch:pr-doc-cmd-entrypoint

Conversation

@sudo-bmitch
Copy link
Contributor

Signed-off-by: Brandon Mitchell git@bmitch.net

- What I did

Documented a behavior where ENTRYPOINT will empty out the value of CMD when CMD is defined from a base image. This behavior has confused others, e.g. this post on stackoverflow and I feel it should be documented somewhere better than an old issue. The original issue where this behavior is described is moby/moby #5147.

- How I did it

This is just a documentation change, no magic here.

- How to verify it

You can see the undocumented behavior with the following Dockerfile:

FROM busybox as base
CMD ["hello", "world"]

FROM base as override
CMD ["hello", "world"]
ENTRYPOINT ["echo"]

FROM base as extended
ENTRYPOINT ["echo"]
$ docker build -t test-cmd-ep --target override .
...
$ docker run --rm test-cmd-ep
hello world
$ docker build -f df.cmd-ep -t test-cmd-ep --target extended .
...
$ docker run --rm test-cmd-ep

$ 

- Description for the changelog

No change.

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

cute animal pic

Signed-off-by: Brandon Mitchell <git@bmitch.net>
@codecov-io
Copy link

Codecov Report

Merging #1523 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1523   +/-   ##
=======================================
  Coverage   55.23%   55.23%           
=======================================
  Files         289      289           
  Lines       19374    19374           
=======================================
  Hits        10702    10702           
  Misses       7977     7977           
  Partials      695      695

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐸

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @sudo-bmitch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants