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

十年热恋 提交于 2019-12-03 14:22:53

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/40592662/what-happens-to-entrypoint-of-docker-parent-image-when-child-defines-another-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!