I got a problem that the [add_host] field does not work at all.
I want to push my image to a private registry(harbor). The LAN address range is 192.168.2.X .
Here is the drone.yml:
kind: pipeline name: test-ci type: docker steps: - name: docker image: plugins/docker settings: add_host: - core-harbor.my.com:192.168.2.200 registry: core-harbor.my.com:30443 repo: core-harbor.my.com:30443/test-ci/one no_cache: true username: from_secret: harbor_username password: from_secret: harbor_password insecure: true tags: v0.55 when: event: push branch: master
Here is the log:
latest: Pulling from plugins/docker Digest: sha256:ac5176110e7378320447551854a12aefdfb757dda1e59d29cecae7f1e729e0a6 Status: Image is up to date for plugins/docker:latest + /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock --insecure-registry core-harbor.my.com:30443 Detected registry credentials Error response from daemon: Get http://core-harbor.my.com:30443/v2/: dial tcp 58.XX.XX.XX:30443: connect: connection refused time="2021-09-21T02:01:58Z" level=fatal msg="Error authenticating: exit status 1"
You can see that “http://core-harbor.my.com:30443/v2/” is redirect to an external IP(this external ip is mine) which is not the ip I 've set(192.168.2.200). I also tried [custom_dns], but it doesn’t help.
It confused me, or maybe its not the correct way to use [add_host] ?
Can someone give me some suggestions? Many thanks