比方说,我已经通过此Dockerfile构建了Docker镜像 parent :
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.
但是由于我是Docker的新手,所以我对此不确定。我的研究还没有得出令人满意的答案。那么上述假设是否正确?
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?
推荐答案使用了最后一个入口点,仅使用了最后一个入口点。
The last entrypoint is used, only the last one.
您可以检查并在 Dockerfile $中放置几行具有不同 ENTRYPOINT 的行c $ c>,并检查会发生什么情况。
You can check, put several lines with different ENTRYPOINT in your Dockerfile, and check what happens.
更多推荐
当子级定义另一个父级映像时,Docker父级映像的入口点会发生什么?
发布评论