8000 Containerd snapshotter does not save layer chain id info in metadata.db for locally built image for platform other than host platform using docker buildx #49955
Labels
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
Description
We had built an image for platform linux/arm64 using docker buildx on amd64 machine.
We were unable to see the layer chainID information for this image in metadata.db from where we could find the linkage to the layer directory number in snapshots folder for that layer.
How should we corelate the layer chain ID info with snapshot directory number then?
Also when we do docker rmi -f ImageID , it does not remove the layer contents from content/blobs/sha256 folder also not from overlayfs/snapshots folder.
Reproduce
Build an image using Dockerfile
docker buildx build --platform linux/arm64 -t my-image .
docker images --tree (fetch the layer from config of the image)
open the metadata.db from /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/metadata.db and search for respective layer chainID
Expected behavior
We were expecting the image layers chainID info in metadata.db before pushing it to registry just same as we get after we pull it from registry if same image is pushed.
docker version
docker info
Additional Info
Please Note: We are trying to scan a multi platform image which is built locally for different platforms like amd64, arm64 etc using buildx tool and for storage driver containerd snapshotter.
We are trying to map the snapshots directories corresponding to the different layers of the image built for for non host OS architecture with the layer chain IDs present in metadata.db (/var/lib/containerd/io.content.containerd.snapshotter.overlayfs)
Using it to get layer directory number from id field of information stored in db per layer chainID.
Now in this, when we are trying to relate it for images built locally lets say for arm64, chainIDs are not available.
But when push this same image to registry and then pull it from there, the expected information is available in metadata.db.
So, Please suggest how should we go about scanning images built locally for non host OS architecture and how can we establish the mapping between chainIDs and snapshot directories for layers?
We understand that metadata.db is internal implementation of containerd and its not recommended to access it directly for external apps but then is there any other way to achive what we are trying to achieve
The text was updated successfully, but these errors were encountered: