-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
some oc image mirror
issues
#19769
Comments
Also I tried to test it with minio. The integrated registry server works fine with it, but
|
@smarterclayton any feedback on this? @legionus i did have a hallway conversation with clayton in which he suggested the s3 aspects of |
Sorry, I need to come back to this. It's possible minio fails because it doesn't support setting HTTP headers? It's also possible that my fix to docker/distribution registry client got accidentally reverted in origin (the one that handles an edge case correctly regarding the absence of a digest). |
Yeah, if you had two S3 buckets how would you publish to different ones with different credentials? s3 config gets complex, I was trying to keep it simple.
Some of the other oc commands deal with origin specifically, i think for more general images we should be explicit. It's always possible the docker hub might not be around forever, and we need to wean people off the defaults somehow. Not the end of the world to support it, but I don't like relying on the defaulting in the long term. Will look at the other two. |
@smarterclayton if you are talking about the change b8366d5, then yes, it was reverted. You can see it in the history of vendor/github.com/docker/distribution/registry/client/repository.go. We've lost it in transition to the publisher bot. Origin's master uses So far, we need to cherry-pick those 2 commits into the docker-distribution tree and cherry pick one of them into origin (probably this is not the only problem, so |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale |
Also:
|
oc image-import documentation (perhaps you meant oc image mirror?): oc image mirror documentation:
while not a direct statement of the need to have a .docker/config.json, it is implicit if you understand how docker login + .docker/config.json work. |
Thanks, the 'oc image mirror' Is it is a valid use case to use 'oc image mirror' as part of BuildConfig Jenkinsfile pipeline inside OKD cluster Jenkins agent to push image from OKD ImageStream (internal Docker registry) to external docker registry? |
yes. (or you can use skopeo). |
So, has anyone managed to get "oc image mirror" working? |
@Gladskih yes, the next command copied the image successfully:
|
@dmage |
@Gladskih feel free to open a new issue. Please include steps to reproduce and output of the mirror command with --loglevel=6. |
Your @dmage advice about When Jenkins pipeline (on Windows worker node) run oc:
When I run oc (from C:\tools):
So when I place a copy of config.json and daemon.json from C:\Users\MyUserName.docker to C:\tools the command completes successfully on my local machine. I created Issue |
According to the documentation:
Actual result:
It happens because this command uses
ParseDockerImageReference
to parse image reference, but this function requires that reference be canonical.https://github.com/openshift/origin/blob/master/pkg/oc/cli/cmd/image/mirror/mappings.go#L29
https://github.com/openshift/origin/blob/master/pkg/oc/cli/cmd/image/mirror/mappings.go#L46
One way to make this link canonical is to specify a domain with a dot or add
localhost
:But even if it turns out so to put something like that, the URL to the image will be:
I did not find a way to fix it.
I found the only way to specify the login and password for S3: The S3 credentials must be encoded and written to the
~/.docker/config.json
manually.Is this really the only way?
When you are using a reference to dockerhub, there are a number of defaults that allow not to specify
docker.io
,latest
as tag andlibrary
component in case the image is official. This works in the docker client, it works in otheroc
sub-commands, but does not work here. The error message does not reflect the essence of the problem:Moreover, the message shows a normalized repository name, which is even more confusing.
The text was updated successfully, but these errors were encountered: