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

Enable registry mirrors in Jib CLI #3134

Merged
merged 3 commits into from
Mar 16, 2021
Merged

Enable registry mirrors in Jib CLI #3134

merged 3 commits into from
Mar 16, 2021

Conversation

mpeddada1
Copy link
Contributor

@mpeddada1 mpeddada1 commented Mar 12, 2021

Fixes #3047.

Did a manual test similar to the one described in #3011 with this config.json:

{"disableUpdateCheck":false,
 "registryMirrors": [
    {
      "registry": "registry-1.docker.io",
      "mirrors": ["mirror.gcr.io", "localhost:5000"]
    }
]
}

(Case where we fall back to Docker Hub):
It first tries mirror.gcr.io and if the base image is not found then it tries localhost:5000. It fails on localhost:5000 with a connection error but doesn't fail the entire build. It finally pulls from Docker Hub.

(Case where we pull from mirror.gcr.io):
And using --from=busybox for example, results in the image being pulled from mirror.gcr.io.

@codecov
Copy link

codecov bot commented Mar 12, 2021

Codecov Report

Merging #3134 (c5b916b) into master (17a333e) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3134      +/-   ##
============================================
- Coverage     71.07%   71.04%   -0.03%     
  Complexity     2319     2319              
============================================
  Files           280      280              
  Lines          9819     9823       +4     
  Branches        992      992              
============================================
  Hits           6979     6979              
- Misses         2494     2498       +4     
  Partials        346      346              
Impacted Files Coverage Δ Complexity Δ
...ain/java/com/google/cloud/tools/jib/cli/Build.java 18.91% <0.00%> (-1.09%) 4.00 <0.00> (ø)
.../main/java/com/google/cloud/tools/jib/cli/Jar.java 43.75% <0.00%> (-1.42%) 14.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17a333e...c5b916b. Read the comment docs.

Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

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

Let's update CHANGELOG.

And in a separate PR, update the CLI README about configuring the registry mirror like in the plugins doc.

@mpeddada1 mpeddada1 merged commit cf77be2 into master Mar 16, 2021
@mpeddada1 mpeddada1 deleted the cli-registry-mirrors branch March 16, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support registry mirrors for base images in Jib CLI
2 participants