当子级定义另一个父级映像时,Docker父级映像的入口点会发生什么?

编程入门 行业动态 更新时间:2024-10-25 19:27:53
本文介绍了当子级定义另一个父级映像时,Docker父级映像的入口点会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

比方说,我已经通过此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 ,并检查会发生什么情况。

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

更多推荐

当子级定义另一个父级映像时,Docker父级映像的入口点会发生什么?

本文发布于:2023-10-31 06:38:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545313.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:映像   入口   定义   发生   Docker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!