gitlab-runner config for docker runner
source link: http://ioridy.github.io/2020/11/02/gitlab-runner-config-for-docker-runner/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
gitlab-runner config for docker runner
在gitlab使用gitlab runner执行CI/CD时,发现每次都要重新拉取docker镜像,即使本地已经有了,也不使用,直接重新拉去,导致流程很慢, 查询了下对应的配置文档,修改配置参数pull_policy为pull_policy = "if-not-present"
,优先使用本地镜像。
配置文件位置
root用户
/etc/gitlab-runner/config.toml
非root用户
~/.gitlab-runner/config.toml
以前是在*nix系统上的,其他系统
./config.toml
配置项是在runners
下的 runners.docker
下的pull_policy
, 如果没有,自己手动添加后,设置值为"if-not-present"
PS:大部分配置的修改,可以不用重启(不包含
listen_address
),runner会没5分钟检查一次文件
所有的配置以及对应的作用可以参考下面的官方文档:
https://docs.gitlab.com/runner/configuration/advanced-configuration.html
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK