rancher 流水线推送私有镜像仓库时错误,错误如下:
1 2 3
| + /usr/local/bin/dockerd-entrypoint.sh /bin/drone-docker + /usr/local/bin/dockerd --data-root /var/lib/docker time="2020-10-15T05:54:37Z" level=fatal msg="Error authenticating: exit status 1"
|
私有仓库地址为ip地址,类似于docker推送镜像包时出现https问题造成,docker解决方案在/etc/docker/daemon.json 添加 “insecure-registries”:[“0.0.0.0/0”],参数即可。
解决方案:
在rancher流水线文件添加参数即可,如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| stages: - name: build steps: - runScriptConfig: image: 10.0.7.150:30002/toolkit/mvn:jdk8-v1 shellScript: |- date mvn clean package -DskipTests - name: Publish steps: - publishImageConfig: dockerfilePath: ./Dockerfile buildContext: . tag: example-mvn:${CICD_EXECUTION_SEQUENCE} pushRemote: true registry: 10.0.7.150:30002 env: PLUGIN_DEBUG: "true" # PLUGIN_INSECURE: "true" # 主要是这个参数即可 - name: Deploy steps: - applyYamlConfig: path: ./deployment.yaml timeout: 60 notification: {}
|