Plugins/docker "exit status 1"

The docker image cannot be pushed to the private repository.Can anyone give me some suggestions?
Drone environment:
Drone Server(drone/drone:1.9.0) on Kubernetes With Helm.
Drone Runner(drone/drone-runner-kube:1.0.0-beta.6) on Kubernetes With Helm.

.drone.yml

- name: build-image
  pull: 
  image:  plugins/docker:linux-amd64
  settings:
    username:
      from_secret:  nuget_username
    password:
      from_secret: nuget_password
    insecure: true
    debug:  true
    # custom_dns: [223.5.5.5]
    repo: 172.16.0.10:7787/ufx/testapi
    registry: 172.16.0.10:7787
    dockerfile: src/${DRONE_REPO_NAME}.HttpApi/app/Dockerfile
    tags: ${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}

Failed Info:

Successfully tagged 75d8854821003cb47dd8b8b29eb652b8fdd6264b:latest
+ /usr/local/bin/docker tag 75d8854821003cb47dd8b8b29eb652b8fdd6264b 172.16.0.10:7787/ufx/testapi:feature_cicd-6
+ /usr/local/bin/docker push 172.16.0.10:7787/ufx/testapi:feature_cicd-6
The push refers to repository [172.16.0.10:7787/ufx/testapi]
time=“2021-05-26T12:14:54.214587108Z” level=info msg=“Attempting next endpoint for push after error: Get https://172.16.0.10:7787/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)”
time=“2021-05-26T12:15:09.214885416Z” level=info msg=“Attempting next endpoint for push after error: Get http://172.16.0.10:7787/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)”
Get http://172.16.0.10:7787/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
time=“2021-05-26T12:15:09Z” level=fatal msg=“exit status 1”

@godzff ,

Could you please pass username and password as docker_usernameanddocker_password, The docker plugin expects secrets named docker_usernameanddocker_password` and test the behaviour.

Regards,
Harness Support

Thanks Reply.
I use the private repository made by nexus3 oss.So docker_username === nuget_username and docker_password === nuget_password.The values of these variables are equal.

Why the empty pull string?

Just so I know as well, but you’ve set up a separate port for the Docker registry inside of Sonatype Nexus, correct?

Also make sure that Realms have been properly configured.

Hi,I fixed pull: if-not-exists.
And, I checked nexus3 ,everything ok


And,I can successfully push the image to nexus3 oss using docker cli on the host

If it’s feasible for you, could you try pushing an image to the Docker registry on the same machine running the Drone Docker runner?

Edit: Could you make sure the repository has privileged mode on? You can also mount the Docker socket directly from /var/run/docker.sock in your pipeline if your system runs Ubuntu.

The GitHub repo mentions using it, though I’m not sure why the plugin’s page doesn’t.

Thanks very much.
When I changed drone runner on docker and used docker pipeline ,It’s working well!
So,I guess there may be some problems with the drone runner on kubernetes

That’s my best guess, I’m not too familiar with Kubernetes though, so your guess is gonna be pretty much as good as mine when it comes to that.

You could try keeping privileged mode on with the Kubernetes runner as well and see if you get any luck with that.

If Docker is working fine for you though, ain’t gonna argue with it.