gitlabrunner之executor配置拉取镜像的账户密码

docker executor

$ cat config.toml
......
[[runners]]
  environment = ["DOCKER_AUTH_CONFIG={\"auths\":{\"registry.xxx.com\":{\"auth\":\"dmlwZXIucm9ib3QuZG9ja2VyOlNUYWkyMDIzLm\"}}}"]
......

k8s executor

# 创建一个imagepullsecret
$ kubectl  create secret generic inner-gitlab --from-file=.dockerconfigjson=/root/runner/config.json --type=kubernetes.io/dockerconfigjson -n gitlab-runner

# cat config.toml
......
    [[runners]]
      [runners.kubernetes]
        image_pull_secrets = ["inner-gitlab"]
......
posted @ 2023-12-15 17:56  yuhaohao  阅读(78)  评论(0编辑  收藏  举报