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

Add registry mirror environment variable option #114

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

jw910731
Copy link
Contributor

Add KANIKO_REGISTRY_MIRROR environment variable that can set mirrors for docker hub.
Useful when rate limited by docker hub.

The KANIKO_REGISTRY_MIRROR environment variable can set to mirror of docker hub.
Useful when rate limited by docker hub.
Copy link
Member

@kylecarbs kylecarbs left a 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"), ";"),
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

envbuilder.go Outdated Show resolved Hide resolved
Deals with thet case when the KANIKO_REGISTRY_MIRROR is not set.
envbuilder.go Outdated Show resolved Hide resolved
@jw910731 jw910731 requested a review from kylecarbs March 26, 2024 15:54
@kylecarbs kylecarbs merged commit 7d6591f into coder:main Mar 26, 2024
1 check passed
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 this pull request may close these issues.

3 participants