Skip to content

Envbuilder fails if lifecycle entries are in OCI metadata #462

Open
@mason3263

Description

@mason3263

When a devcontainer is built lifecycle scripts can be included in the metadata. If this is the case envbuilder fails to unmarshal the metadata embedded in the OCI image. I believe envbuilder is trying to parse the metadata using the Spec struct in devcontainer.go file.

{
    "Name": "my-image",
    "Digest": "sha256:ad63b47f418820329b1f0aa0f707ad590cc6b63efdc9de86bdd76f1fa6c329b0",
    "RepoTags": [
        "latest"
    ],
    "Created": "2025-05-17T03:14:27.157348203Z",
    "DockerVersion": "",
    "Labels": {
        "devcontainer.metadata": "{\"postAttachCommand\":\"bash /scripts/entrypoint.bash\",\"containerEnv\":{\"DISPLAY\":\"${localEnv:DISPLAY}\",\"VISUAL\":\"code --wait\",\"EDITOR\":\"code --wait\",\"GIT_EDITOR\":\"code --wait\",\"CC\":\"/usr/bin/clang\",\"CXX\":\"/usr/bin/clang++\"}}",
        "io.buildah.version": "1.39.4",
        "org.opencontainers.image.ref.name": "ubuntu",
        "org.opencontainers.image.version": "22.04"
    },
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions