canonical / rockcraft

Tool to create OCI Images using the language from Snapcraft and Charmcraft.
GNU General Public License v3.0
35 stars 43 forks source link

Using the 'Dive' tool to explore the ROCK/OCI content is broken #38

Closed valentincanonical closed 2 years ago

valentincanonical commented 2 years ago

Referring to the https://github.com/wagoodman/dive tool to explore the content of an image, once imported in the local docker registry.

I noticed two different situations,

1) As discussed before, sometimes Dive will simply fail to open the image. This seems related to the use of whiteout files and a wrong interpretation of the OCI spec on their end.

2) But even when Dive will open the image and explore it, it is not possible to collapse the directories (hitting Space or Ctrl+Space). This only happened to me with images built using Rockcraft.

sergiusens commented 2 years ago

This might be related to the recently closed #44 (given the root cause for it)

cmatsuoka commented 2 years ago

The layer flattener is not removing unnecessary whiteout files after the package cache layer is removed. This can be fixed tracking whiteout files in each layer and verifying if there's an underlying file to be whited out.

tigarmo commented 2 years ago

For issue 2, I think #44 did fix this. I created a new image with a /etc/newfiles dir and I can collapse/expand normally: dive-repro

Not sure about issue 1, though. Is there an easy way to repro?

cmatsuoka commented 2 years ago

I reproduced the dive error using the rockcraft tutorial yaml. Problems were caused by dangling whiteout files after the layer containing files to be whited out were removed from the layer stack. A final pass now removes the dangling whiteouts, this fix is available in craft-parts 1.13.0.