-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add registry mirror environment variable option #114
Conversation
The KANIKO_REGISTRY_MIRROR environment variable can set to mirror of docker hub. Useful when rate limited by docker hub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
envbuilder.go
Outdated
@@ -656,6 +656,7 @@ func Run(ctx context.Context, options Options) error { | |||
Insecure: options.Insecure, | |||
InsecurePull: options.Insecure, | |||
SkipTLSVerify: options.Insecure, | |||
RegistryMirrors: strings.Split(os.Getenv("KANIKO_REGISTRY_MIRROR"), ";"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about splitting on
instead? ;
seems a bit less standard to me.
It'd be great to add a comment linking to this PR and these docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I references the environment variable design in Kaniko (link), it uses ;
to separate multiple registry map.
I think it might be better if we follows Kaniko's environment variable format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
Deals with thet case when the KANIKO_REGISTRY_MIRROR is not set.
Add
KANIKO_REGISTRY_MIRROR
environment variable that can set mirrors for docker hub.Useful when rate limited by docker hub.