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

kaniko tar image is not compatible with dive #318

Open
lukasmrtvy opened this issue Sep 17, 2020 · 10 comments
Open

kaniko tar image is not compatible with dive #318

lukasmrtvy opened this issue Sep 17, 2020 · 10 comments

Comments

@lukasmrtvy
Copy link

Kaniko image produced by --no-push --destination image --tarPath image.tar args is not compatible with dive..

I am getting:

Image Source: docker-archive://image.tar
Fetching image... (this can take a while for large images)
cannot fetch image
could not find image config
@lewisboon
Copy link

Kaniko (and Crane which I've also had a problem with) do not create tars in the same format as Docker. Unfortunately my knowledge of the Docker image spec is limited.

The key problem is here.
Dive only considers files ending in .json. Kaniko image config files are called sha256:<sha>. This file isn't stored by Dive.

Other differences relate to the layers as well.

Kaniko each layer is a single .tar.gz file. No additional files.
Docker creates a folder for each layer which contains: VERSION, json, and the tar (no gz) of the layer. Does dive need the json file?

Note that crane pull has the ability to output as legacy (--format legacy), which matches the format that Docker outputs.


So far, I believe Dive needs the following changes:

I expect there will be code changes for handling the tar.gz files differently to tar?

Hope this helps!

@avisiedo
Copy link
Contributor

Same situation here. I have modified by hand the archive file generated with kaniko, and after changing the "Config" attribute removing the "sha256:" prefix, adding the ".json" suffix and renaming the file, started to read that file; for the Layer files I unpacked them and I modified the manifest.json accordingly to match the filenames (removing the .gz suffix). After repacking the docker-archive again, dive tool worked perfectly.

My doubt here is:

  • Is kaniko generating the docker-archive file according the docker-archive specifications (where could I find that specifications?)?
  • Or, is dive tool handling improperly the docker-archive files generated by kaniko?

BTW, some changes in dive to support both archives would be very nice to have.

@dvonessen
Copy link

dvonessen commented Mar 3, 2021

I have this problem too. I know, I can self build dive to get the latest changes. But @wagoodman is it possible to get a new release?

@lukasmrtvy
Copy link
Author

@wagoodman what is status of this project, is it unmaintained ? thanks ( p.s. i would like to see new release also )

@wagoodman
Copy link
Owner

@dvonessen and @lukasmrtvy , thanks for the poke! Short answer is yes, I'll cut a release today 👍 . With regard to "is this an unmaintained project" --no, though it has fallen from a 20% project to a 2% project. I'm hoping to get more time in the near future (fingers crossed!)

@dvonessen
Copy link

I think this you can close this issue.

@Arsenyx
Copy link

Arsenyx commented Jan 29, 2024

I installed release 0.11 on minimal installations from Fedora38, AlmaLinux9 and OracleLinux8 from RPM and everywhere the same answer:
$ dive hello-world
Image Source: docker://hello-world
Fetching image... (this can take a while for large images)
cannot fetch image
could not find image config
Is it possible that some additional package needs to be installed?
but if you install the utility using Snap, then it works great

@wh877
Copy link

wh877 commented Feb 2, 2024

Fedora 39.
Dive version 0.11.0 -- The same error.

For me it doesn't work regardless the way I install it. I tried RPM, brew, snap and docker - nothing works. It used to be working some time ago though (maybe a year or so).

@bderrly
Copy link

bderrly commented Feb 9, 2024

@wagoodman, I am fairly certain I ran dive (0.11.0) successfully on a container I built a couple of weeks ago and now today the same version of dive is failing on the same container image. I have no idea how this could be the case.

@bderrly
Copy link

bderrly commented Feb 12, 2024

@wagoodman, I am fairly certain I ran dive (0.11.0) successfully on a container I built a couple of weeks ago and now today the same version of dive is failing on the same container image. I have no idea how this could be the case.

I just updated to version 0.12.0 and it is working on my container images now. I'm guessing #500 is the reason.

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

No branches or pull requests

8 participants