-
Notifications
You must be signed in to change notification settings - Fork 215
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
Does porter archive or copy really need to consult index.docker.io for bundled images? #1609
Comments
Hi @jasmdk, let me recap how to move a bundle across an airgap, and copy it between registryes, and then we can compare that to the commands that you used.
|
Hi @carolynvs, I agree with the steps you outline.
In neither case can I see the need for consulting docker.io to copy the image as it is already bundled, but some metadata probably still knows about the original location and uses that. |
It sounds like you may have found a bug, but I am unclear on the reproduction steps. The steps I outlined should not hit the original registry once the bundle is relocated to another. Are you able to reproduce this with a test bundle, for example getporter/whalegap:v0.1.0? If you can provide a set of steps for me to follow with a public bundle, then I can get a fix out for you. |
To reproduce these airgapped scenarios, I assume you have a local (here insecure) registry running like: To start with your "whalegap" bundle, do: Now unplug your internet and copy the bundle already copied to the registry to another destination - here just another tag in the same registry:
If I plug in my internet again and repeat, the operation succeeds. Another scenario is the "archive" action. Again unplug internet and do:
But succeeds if you have an internet connection. Another thing worth noting is that for all of the above, I have configured my docker daemon with a registry mirror to minimize calls to docker.io, but none of these seem to care about my mirror settings - nor does "porter publish". |
Thanks for the reproduction steps. I believe the bug is with copy and I have opened an issue against the cnab-to-oci library to track it. If you follow the steps that I outlined above in my original reply, you should be able to work around the bug until we have a fix, i.e. use archive+publish to move a bundle instead of copy. |
Thanks - it does work as airgapped once the bundle has been exported. |
I have an upstream PR to fix cnab-to-oci's copy functionality. I expect that to be merged soon and then I'll cut a release of Porter with the fix. |
Thank you for your quick response - as usual :-) |
Fixes getporter#1609, where the relocation map wasn't being used when copying a bundle. Signed-off-by: Carolyn Van Slyck <[email protected]>
This should now be fixed in v0.38.3 |
Is your feature request related to a problem? Please describe.
Due to the pull-rate-limitation imposed by docker.io, working with porter bundles often reach the limit on our CI setups.
Locally developers have a docker user and docker daemon on CI agents have been configured with a registry-mirror, but anyway when I archive or copy a bundle which includes bundle images, it still accesses the REST API on index.docker.io for images which originally came from docker hub. I would assume that once I published the bundle to my own registry, it contained all the information I need for an airgapped setup.
Publish works without any issues, but I cant archive the bundle to disc first in these scenarios.
The log indicates that during copy or archive, the referenced images are copied from the original source rather than the already bundled copy of the image.
Describe the solution you'd like
Eliminate the callbacks to the original docker registry for images which are already bundled. The information needed should already be present in the bundle.
Describe alternatives you've considered
At least document the limitations of using porter in airgapped scenarios.
Additional context
Output:
porter copy --source host.docker.internal:5443/library/airgapped:latest --destination registry.admin.synergy.local:21443/library/airgapped:copied2
Beginning bundle copy to registry.admin.synergy.local:21443/library/airgapped:copied2. This may take some time.
Starting to copy image host.docker.internal:5443/library/airgapped-installer:latest...
Completed image host.docker.internal:5443/library/airgapped-installer:latest copy
Starting to copy image busybox:latest...
Failed to copy image busybox:latest: failed to resolve or push image for service "busybox"
Error: unable to copy bundle to new location: error preparing the bundle with cnab-to-oci before pushing: failed to resolve or push image for service "busybox"
The text was updated successfully, but these errors were encountered: