作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对于我遇到过的所有Dockerfile(虽然数量不多),它们都使用FROM
子句作为现有镜像的基础,即使它是FROM scratch
。
这个条款是必需的吗?有没有FROM
子句的Dockerfile是否可能?这样创建的容器可以执行任何操作吗?
编辑
我读
A Dockerfile with no FROM directive has no parent image, and is called a base image.
最佳答案
根据官方文档,它是必需的:
The FROM instruction initializes a new build stage and sets the Base Image for subsequent instructions. As such, a valid Dockerfile MUST start with a FROM instruction. The image can be any valid image – it is especially easy to start by pulling an image from the Public Repositories.
关于docker - Dockerfile中是否需要 `FROM`子句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58330046/
我是一名优秀的程序员,十分优秀!