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

jibBuildTar create wrong OCI format tarbal #2124

Closed
lfarkas opened this issue Nov 5, 2019 · 8 comments · Fixed by #2181
Closed

jibBuildTar create wrong OCI format tarbal #2124

lfarkas opened this issue Nov 5, 2019 · 8 comments · Fixed by #2181
Assignees
Milestone

Comments

@lfarkas
Copy link

lfarkas commented Nov 5, 2019

When run the jibBuildTar gradle target and the container.format='OCI' set the resulted jib-image.tar still not contains index.json.

Per the OCI image spec, there must be an index.json file present in OCI format images: https://github.com/opencontainers/image-spec/blob/master/image-layout.md

@loosebazooka
Copy link
Member

I don't think we've looked at this code path for a while. Is everything else okay when generating the tar? Is just the index.json missing?

@lfarkas
Copy link
Author

lfarkas commented Nov 5, 2019

I don't know. actually I'd like to docker/podman pull the image into my local images to be able to run locally with have to push to a registry and then found this bug (since currently that's the only way AFAIK).
Anyway I'm also vote for this issue #1664 since than it solve all of such problems.

@chanseokoh
Copy link
Member

I'd like to understand this a bit more.

I don't know. actually I'd like to docker/podman pull the image into my local images to be able to run locally with have to push to a registry and then found this bug (since currently that's the only way AFAIK).

It makes sense for jibBuildTar to produce a tarball with the OCI format image layer, but are you aware that Docker CLI and daemon don't yet support loading (or saving) a tar, zip, or unpacked contents of the OCI image layout anyways? That is, if jibBuildTar created a tarball with the OCI image layout, you can no longer load it into the local Docker. I don't know about podman though.

And if you haven't noticed, jibDockerBuild will work fine with container.format='OCI'. The truth is, when it comes to the local Docker, it is neither OCI nor Docker Registry V2 manifest, so container.format doesn't play any role with jibDockerBuild. The local Docker just uses it's own legacy format.

Anyway I'm also vote for this issue #1664 since than it solve all of such problems.

And to be clear, fixing #1664 won't address this issue. It's an independent issue concerning only the configuration syntax.

@lfarkas
Copy link
Author

lfarkas commented Nov 14, 2019

I'd like to understand this a bit more.

I don't know. actually I'd like to docker/podman pull the image into my local images to be able to run locally with have to push to a registry and then found this bug (since currently that's the only way AFAIK).

It makes sense for jibBuildTar to produce a tarball with the OCI format image layer, but are you aware that Docker CLI and daemon don't yet support loading (or saving) a tar, zip, or unpacked contents of the OCI image layout anyways? That is, if jibBuildTar created a tarball with the OCI image layout, you can no longer load it into the local Docker. I don't know about podman though.

I tried it with podman. what's more report it to podman and they point me to the standard. and after this i looked into the tarball which is in a wrong format.

And if you haven't noticed, jibDockerBuild will work fine with container.format='OCI'. The truth is, when it comes to the local Docker, it is neither OCI nor Docker Registry V2 manifest, so container.format doesn't play any role with jibDockerBuild. The local Docker just uses it's own legacy format.

yes but in this case you can write a jibPodmanBuild which can work.

Anyway I'm also vote for this issue #1664 since than it solve all of such problems.

And to be clear, fixing #1664 won't address this issue. It's an independent issue concerning only the configuration syntax.

yes it's true, but in that case the user of this plugin can more easy usage and configuration eg: as you write oci-archive:// you shouldn't have to handle container.format='docker' etc...

@TadCordle
Copy link
Contributor

TadCordle commented Nov 21, 2019

Would you mind giving more details on how to reproduce the bug you're seeing? When I run ./gradlew jibBuildTar -Djib.container.format="OCI", then podman load < build/jib-image.tar, the image still loads and runs fine with podman run, most likely because it's still a valid docker tar. Is there a way to force podman into expecting an OCI tar?

I'm new to podman, so sorry if there is an obvious answer to this question 😄

@lfarkas
Copy link
Author

lfarkas commented Nov 22, 2019

try:
podman pull oci-archive:....../jib-image.tar

@TadCordle
Copy link
Contributor

@lfarkas We've released 2.0.0, which will build OCI tars in the correct format. The caveat is that additional tags don't quite work yet; see #2190 and the relevant issues at the end of the description.

@lfarkas
Copy link
Author

lfarkas commented Feb 11, 2020

seems to working

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 a pull request may close this issue.

4 participants