What happens to entrypoint of Docker parent image when child defines another one?

InheritanceDockerEntry Point

Inheritance Problem Overview


Let's say I've got the Docker image parent built by this Dockerfile:

FROM ubuntu
ENTRYPOINT ["parent-entry"]

Now I inherit from this parent image in my child image built with this code:

FROM parent
ENTRYPOINT ["child-entry"]

As far as I have tested it the entrypoint of the child image overwrites the one in the parent image.

But since I am new to Docker I am not sure about this. My research also hasn't yet resulted in a satisfying answer. So is the assumption above correct?

Inheritance Solutions


Solution 1 - Inheritance

The last entrypoint is used, only the last one.

You can check, put several lines with different ENTRYPOINT in your Dockerfile, and check what happens.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHarold L. BrownView Question on Stackoverflow
Solution 1 - Inheritanceuser2915097View Answer on Stackoverflow