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

Handle Docker V2.1 image format or provide better error message. #601

Closed
coollog opened this issue Jul 13, 2018 · 3 comments
Closed

Handle Docker V2.1 image format or provide better error message. #601

coollog opened this issue Jul 13, 2018 · 3 comments
Assignees
Milestone

Comments

@coollog
Copy link
Contributor

coollog commented Jul 13, 2018

Original comment by @jorgemoralespou #534 (comment):

I would think that nowadays there are very few (close to none) users with older versions of docker cli, but it would be good to support both schema1 and schema2 in the plugin, defaulting to schema2 but with the ability to override the value, and obviously a nicer error message explaining to the user what to do in case he get's a response from the registry that schema2 is not supported.

@briandealwis
Copy link
Member

skopeo, a command-line tool for inspecting and copy container images, can read our tarballs and push the image to registries that only support v2-1 schemas.

$ mvn jib:buildTar
[…]
$ skopeo copy -dcreds user:pass tarball:target/jib-image.tar docker://quay.io/briandealwis/foo 
Getting image source signatures
Copying blob sha256:ca6b4ac8b25124deb3789851b58f94a1d31cab13af7d2ef9d64e3541d27e0973
 46.99 MB / 46.99 MB [======================================================] 8s
Copying config sha256:8d224412a288d1f8dcd66c74d263de411cf4a4f2753f03fe51700646d69ebabc
 420 B / 420 B [============================================================] 1s
Writing manifest to image destination
Copying config sha256:8d224412a288d1f8dcd66c74d263de411cf4a4f2753f03fe51700646d69ebabc
 0 B / 420 B [--------------------------------------------------------------] 0s
Writing manifest to image destination
Writing manifest to image destination
Storing signatures

Unfortunately there are no pre-built binaries of skopeo and installation is a bit… tricky (if you're a Go newbie like myself).

@jorgemoralespou
Copy link

jorgemoralespou commented Jul 26, 2018

@briandealwis, skopeo does not require any install. It uses go libraries internally and is a go binary, not sure how you can leverage it in jib, but I'm any case, if you need any type of help from Red Hat, you can reach out directly to @runcom, author of the tool, for questions.

@briandealwis
Copy link
Member

briandealwis commented Jul 26, 2018

@jorgemoralespou: I was investigating whether skopeo as a workaround to save us from having to implement support for the v2-2 v2-1 schema format, until registries like OpenShift and Quay.io support v2-2. One possibility people could build to a tarball and then call out (somehow) to skopeo to push the build result to a v2-1 registry.

Skopeo does have some installation requirements: it requires installing a policy file to /etc/containers/policy.conf, and it requires gpgme to be installed somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants