Ray*_*ayB 3 continuous-integration drone.io
在使用无人机时,我见过几个pull: true按步骤设置的情况。尽管尚不清楚是否需要这样做,因为某些步骤省略了它。
PS:我写这篇文章并回答我自己的问题是因为我很难找到文档来解释这一点,并且想让其他人更容易找到。
你会看到pull: true很多,因为无人机 0.X 默认不升级图像。从无人机1.0开始默认是升级图像。
如果本地缓存中不存在该镜像,Drone 会指示 Docker 自动拉取该镜像。您永远不需要手动拉取图像。
如果映像显式或隐式地使用 :latest 标记,则 Drone 会尝试从远程注册表中提取最新版本的映像,即使该映像存在于本地缓存中也是如此。
pull: if-not-exists # only pull the image if not found in the local cache
pull: always # always pull the newest version of the image
pull: never # never pull the image and always use the image in the local cache
Run Code Online (Sandbox Code Playgroud)
Drone 不会自动升级 docker 镜像。当更新可用时始终提取最新映像的示例配置:
pipeline:
build:
image: golang:latest
pull: true
Run Code Online (Sandbox Code Playgroud)
这是因为 CI 的可重复性是关键,进一步的更新可能会破坏您的构建。来源
| 归档时间: |
|
| 查看次数: |
1998 次 |
| 最近记录: |