Skip to content

Layer annotations from parent images are not preserved during commit #6652

@jlebon

Description

@jlebon

Issue Description

When building an image using FROM with a source that contains layer annotations, the final committed image loses those annotations.

Steps to reproduce the issue

  1. Pick an image with layer annotations, e.g.:
skopeo inspect -n docker://quay.io/fedora/fedora-bootc | jq -c .LayersData[].Annotations | head
  1. Build from it
buildah from quay.io/fedora/fedora-bootc
buildah run fedora-bootc-working-container touch /var/foo
img=$(buildah commit fedora-bootc-working-container)
  1. Check annotations on the new image
skopeo inspect containers-storage:2ef0c13fe7c39b5ed319595f880be69996fe0d93e110076a748f57ce12745bb3 | jq .LayersData[].Annotations | head

Describe the results you received

Annotations for base layers not retained.

Describe the results you expected

Annotations for base layers are retained.

buildah version output

Version:         1.42.2
Go Version:      go1.25.4 X:nodwarf5
Image Spec:      1.1.1
Runtime Spec:    1.2.1
CNI Spec:        1.1.0
libcni Version:
image Version:   5.38.0
Git Commit:
Built:           Wed Dec  3 09:00:34 2025
OS/Arch:         linux/amd64
BuildPlatform:   linux/amd64

buildah info output

{
    "host": {
        "CgroupVersion": "v2",
        "Distribution": {
            "distribution": "fedora",
            "version": "43"
        },
        "MemFree": 15124185088,
        "MemTotal": 67100504064,
        "OCIRuntime": "crun",
        "SwapFree": 4296781824,
        "SwapTotal": 8589930496,
        "arch": "amd64",
        "cpus": 16,
        "hostname": "flux",
        "kernel": "6.17.12-300.fc43.x86_64",
        "os": "linux",
        "rootless": true,
        "uptime": "462h 42m 41.19s (Approximately 19.25 days)",
        "variant": ""
    },
    "store": {
        "ContainerStore": {
            "number": 25
        },
        "GraphDriverName": "overlay",
        "GraphImageStore": "",
        "GraphOptions": null,
        "GraphRoot": "/var/home/jlebon/.local/share/containers/storage",
        "GraphStatus": {
            "Backing Filesystem": "btrfs",
            "Native Overlay Diff": "true",
            "Supports d_type": "true",
            "Supports shifting": "false",
            "Supports volatile": "true",
            "Using metacopy": "false"
        },
        "GraphTransientStore": false,
        "ImageStore": {
            "number": 1306
        },
        "RunRoot": "/run/user/1000/containers"
    }
}

Provide your storage.conf

I don't think that matters here but happy to provide it if you'd like. I regularly podman system reset -f my system and never touch storage.conf.

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

Also happens with buildah bud and the FROM oci-archive: trick. This makes annotations added by chunkah in the build-time path not actually persist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.stale-issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions