docker - Dockerfile 中的 Docker FROM 关键字是否会查找最新的镜像?

标签 docker dockerfile

我有一个 CI Runner,可以自动从 Dockerfile 构建 docker 镜像。我的 docker 镜像基于另一个 docker 镜像。所以我的 Dockerfile 的开头如下所示:

FROM linktoimage/imagename:latest

docker 在构建过程中是否检查我的本地版本的 imagename 是否仍然是最新的(类似于 docker pull?因为我注意到我的 ci 运行程序显示了旧版本的 imagename 如果我在上面运行docker images

最佳答案

Does docker check during the build process if my local version of imagename is still the latest (similar to docker pull)?

不,由于构建缓存,docker 默认情况下不会执行此操作。它将使用本地缓存中的任何现有图像[ 1 ].

但是,您可以使用 --no-cache 选项启用您想要的行为:

$ docker build . --no-cache=true

关于docker - Dockerfile 中的 Docker FROM 关键字是否会查找最新的镜像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74141587/

相关文章:

由于 docker 容器中的 "database is locked",swift 构建失败?

curl - OpenShift 3.1 - 防止 Docker 缓存 curl 资源

docker - pod 容器无法解析运行它的主机

scala - 运行spark NetworkWordCount示例时无输出

java - 如何为使用 kafka 和 cassandra 的应用程序设置/创建 docker 镜像

docker - 使用webpack-dev-server从webpack 2代理请求到docker容器中的后端api

docker - 在 Docker 构建期间安装 brew 包不起作用

docker - 什么是 Docker 构建阶段?

python - 尝试使用Docker访问MongoDB时,连接被拒绝[Errno 111]

docker - Mac 上 Docker 中的各种缓存是否损坏?