Skip to content
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

if registry mirror does not have it, can you default it to index.docker.io #1473

Closed
darewreck54 opened this issue Oct 30, 2020 · 4 comments · Fixed by #1498
Closed

if registry mirror does not have it, can you default it to index.docker.io #1473

darewreck54 opened this issue Oct 30, 2020 · 4 comments · Fixed by #1498

Comments

@darewreck54
Copy link

darewreck54 commented Oct 30, 2020

This is more of a question. Right now Kaniko allows you to specify a registry mirror --registry-mirror. Is it possible to have it look at the registry mirror first and if it's not there than pull from the default index.docker.io. In other words, support multiple registry mirrors.

The main desire for this is that dockerhub is limiting API calls to 100 per 6 hours. We wanted to utilize google's mirror container registry. However, if it does not contain the image kaniko will fail. Google doesn't copy the image to the mirror right away and it will remove unused mirrors if it's not referenced

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

erzz commented Nov 13, 2020

Yes Kaniko has what (I would consider) breaking behaviour compared to Docker!!

  • Docker daemon will try the mirror first and then revert to docker hub if its not cached in the mirror.
  • Kaniko will just fail to pull from mirror.gcr.io and fail

With this odd re-interpretation of registry-mirror then we have many builds that fail after switching to Kaniko and instead I need start scripting efforts to get around it.

Given the increased usage of mirrors (and in all other tools I am aware of it, registry mirror is a pull through like Docker daemon) I would like to see this as the top priority for a fix!

vbehar added a commit to vbehar/kaniko that referenced this issue Nov 20, 2020
Fixes GoogleContainerTools#1473

The initial implementation of the registry mirror only allowed a single mirror, and if pulling from the mirror failed, the build would fail.

This change introduce:
- multiple registry mirrors instead of a single one
- fallback if an image can't be pulled from a registry

This is the same behaviour as the docker daemon, and will allow to use a registry mirror such as `mirror.gcr.io` which is incomplete, and doesn't have all the content that the default registry on docker.io has.

Note that there are no changes in the CLI flags, the `--registry-mirror` flag is still valid. But now it can be used multiple times to setup more than one registry mirror.
vbehar added a commit to vbehar/kaniko that referenced this issue Nov 20, 2020
Fixes GoogleContainerTools#1473

The initial implementation of the registry mirror only allowed a single mirror, and if pulling from the mirror failed, the build would fail.

This change introduces:
- multiple registry mirrors instead of a single one
- fallback if an image can't be pulled from a registry

This is the same behavior as the docker daemon and will allow using a registry mirror such as `mirror.gcr.io` which is incomplete and doesn't have all the content that the default registry on docker.io has.

Note that there are no changes in the CLI flags, the `--registry-mirror` flag is still valid. But now it can be used multiple times to set up more than one registry mirror.
@angelsantillana94
Copy link

I have the same problem. I need multiples registry mirrors or at least, when my private registry is not available, the execution of kaniko can continue and does not fail.

@vbehar
Copy link
Contributor

vbehar commented Dec 2, 2020

there is a PR ready at #1498 which is just waiting for review... if you really need it, you can build it locally and push it to your own registry. We've been using it for all our builds and it works nicely.

@angelsantillana94
Copy link

I really appreciate your PR. Although the option you are telling me helps me, I prefer to wait for it to be reviewed and officially implemented.

tejal29 added a commit that referenced this issue Dec 9, 2020
Fixes #1473

The initial implementation of the registry mirror only allowed a single mirror, and if pulling from the mirror failed, the build would fail.

This change introduces:
- multiple registry mirrors instead of a single one
- fallback if an image can't be pulled from a registry

This is the same behavior as the docker daemon and will allow using a registry mirror such as `mirror.gcr.io` which is incomplete and doesn't have all the content that the default registry on docker.io has.

Note that there are no changes in the CLI flags, the `--registry-mirror` flag is still valid. But now it can be used multiple times to set up more than one registry mirror.

Co-authored-by: Tejal Desai <tejaldesai@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants