概述
在使用docker版本的gitlab-runner构建docker镜像时,每次都会重新pull镜像
处理
在config.toml文件,加上:pull_policy = "if-not-present",如下所示:
concurrent = 1
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "linux"
url = "https://git/"
id = 21
token = "cccccc"
token_obtained_at = 2024-08-07T11:50:56Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
[runners.docker]
tls_verify = false
pull_policy = "if-not-present"
image = "docker:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock","/cache"]
shm_size = 0
network_mtu = 0
结果
借鉴
https://blog.csdn.net/weixin_41915314/article/details/109587493
评论区