ZBLOG

gitlab-runner register 指定docker注册中心

可以通过在 config.toml 文件中设置 [[runners.docker]]registry_mirror 参数来指定 Docker 注册中心。

具体步骤如下:

  1. 打开 config.toml 文件,找到并编辑以下行:
[[runners]]
  executor = "docker"
  [runners.docker]
    # ...
    registry_mirror = "https://your.registry.mirror"
  1. https://your.registry.mirror 替换为你的 Docker 注册中心地址。

  2. 保存文件并重新启动 GitLab Runner。

注意事项:

  1. 如果需要使用私有仓库,还需添加 Docker Hub 账号信息,例如:
[[runners]]
  executor = "docker"
  [runners.docker]
    image = "ubuntu:latest"
    privileged = true
    disable_cache = false
    volumes = ["/cache"]
    pull_policy = "if-not-present"
    registry_mirror = "https://your.registry.mirror"
    username = "your_dockerhub_username"
    password = "your_dockerhub_password"
  1. 如果你的 Docker 注册中心要求认证,那么还需设置 [[runners.docker]]tls_verifytls_cert_pathtls_key_path 参数,以及 [[runners.docker]] 下的 image 参数。

总的来说,可以根据实际情况调整配置参数。

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=1993

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?