-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using multiple Registries bug #918
Comments
I'm pretty sure pulling a base image from a public registry and pushing to a private registry works as thats what I do daily for testing and such. There might be some edge case here, but it might be related to auth on your private registry rather than combination of public and private. If you don't mind me asking, what private registry are you using? (Service provider or project name would be great) |
I'm using the Scaleway Registry. |
@ArnaudWald Does |
Have same error with latest Kaniko images. Checked via k8s and local docker. Docker registry has cert and I'm able to push new image from docker but with Kaniko it doesn't work
Run docker:
End error message at end:
|
Sorry the problem was in docker-compose file for registry, in ENV params.
Env params was incorrect - REGISTRY_HTTP_HOST: https://XXX.XXX.XXX:443, just delete and everything works |
I'm having a similar issue, but my image is
The configuration is the same in both cases, just the runner that changes:
|
Same issue here. We're using GCR for {
"auths": {
"XXX.dkr.ecr.us-east-1.amazonaws.com": {
"auth": "YYY"
}
}
} or {
"credsStore": "gcr"
} works, but when we supply both: {
"credsStore": "gcr",
"auths": {
"XXX.dkr.ecr.us-east-1.amazonaws.com": {
"auth": "YYY"
}
}
} then we are getting the above error ( |
Here is a sequence diagram of authn : a package used by Kaniko. After the 401 is received from the Registry, does kaniko send out the next request: GetAuthConfig()? |
Does anyone found workaround? |
@insider89 release v1.11.0 should have fixed this issue. Are you still seeing this issue? |
@tejal29 Looks like fixed. I am using following version I am using gitlab CI to run kaniko. Before run kaniko I log in to both ecr and gcr, and then mount
|
In case this helps anyone, I wasn't able to get any combination of This creates two
This worked fine for me and was the only way I found to have simultaneous ECR and GitLab authentication in a single kaniko 1.6.0 invocation. I'm using this in a GitLab-CI pipeline that pulls down GitLab registry images and pushes them to ECR. |
The same trick does not work with Docker. When I add
I guess that means that the contents of |
Still the same issue in 2024, auth must be a base64-encoded value. |
I am trying to build on top of a public DockerHub image, and push the result into my private registry.
My Dockerfile:
The command I run
Result
The initial permission checking succeeds, the build is successful, but I cannot push, I get
error pushing image: failed to push to destination my-private-registry/testkaniko/test-kani:latest: unsupported status code 401; body: Unauthorized request
Full log
My interpretation
It seems for the debug that kaniko is trying to get the image from the public docker hub. However, there is no credentials, so it fall back to an
anonymous
identity to pull the base image. And then it does not switch back when trying to push after the build succeeds.Workaround
A workaround I did is to stay on my private registry from start to finish.
docker pull python:3
docker tag python:3 my-private-registry/test-kaniko/python:3
docker push my-private-registry/test-kaniko/python:3
FROM my-private-registry/test-kaniko/python:3
Note: I though about adding two auths in the
config.json
for each registry, like this:However, this does not fix the issue
Therefore, my question is : is there a better way to use different registries for running my Kaniko pipelines ? Or is this an unexpected behavior ?
The text was updated successfully, but these errors were encountered: