kaniko: unable to push to Harbor

Actual behavior I am using Kaniko in a Tekton pipeline to push images to my Harbor registry, but I can’t push without being logged in.

Expected behavior I would like to know if there is a way to provide the registry username and password to kaniko in order to do a “docker login my.registry.harbor.net” before trying to push. Thank you !

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [Yes ]
Please check if the build works in docker but not in kaniko
  • - [Yes ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

About this issue

Most upvoted comments

i build and push image successfully at last,i must create file as you said@jameshearttech and must add the environment which the document not mentioned, and with http harbor i must add --insecure and --skip-tls-vertify.i had to say the document and error log isn’t friendly.this is a good tool,but need better document and examples for newbie.

I had the same issues until I understood that DOCKER_CONFIG must point to the folder containing config.json, not to the file itself. After I got that and configured it accordingly, all went butter smoothly. Just use this type of config:

{
  "auths": {
    "harbor.domain.name": {
      "auth": "base64(login:password)"
    }
  }
}

Note that in my setup I wasn’t prefixing the harbor domain name with http:// or https:// (it is running on https), wasn’t postfixing it with /v2, and it was working pretty well.