Skip to content

Devcontainer.Metadata Label can be a Dictionary or List #1054

@mason3263

Description

@mason3263

When a devcontainer is built off an image without a devcontainer.metadata label the resulting image will have a devcontainer.metadata label that is a dictionary instead of a list(assuming there aren't any features that also append to the label). For example when I build my base image I get a config with the following labels:

  "Labels": {
        "devcontainer.metadata": "{\"remoteUser\":\"fedora\"}",
        "io.buildah.version": "1.40.1",
        "license": "MIT",
        "name": "fedora",
        "org.opencontainers.image.license": "MIT",
        "org.opencontainers.image.name": "fedora",
        "org.opencontainers.image.url": "https://fedoraproject.org/",
        "org.opencontainers.image.vendor": "Fedora Project",
        "org.opencontainers.image.version": "42",
        "vendor": "Fedora Project",
        "version": "42"
    },

After creating another image using this image as a base I get the following labels:

    "Labels": {
        "devcontainer.metadata": "[ {\"remoteUser\":\"fedora\"}, {\"remoteUser\":\"fedora\"} ]",
        "io.buildah.version": "1.40.1",
        "license": "MIT",
        "name": "fedora",
        "org.opencontainers.image.license": "MIT",
        "org.opencontainers.image.name": "fedora",
        "org.opencontainers.image.url": "https://fedoraproject.org/",
        "org.opencontainers.image.vendor": "Fedora Project",
        "org.opencontainers.image.version": "42",
        "vendor": "Fedora Project",
        "version": "42"
    },

Adding features to an image will have the same effect and create the metadata as a list. On the devcontainer website it says the devcontainer.metadata label "can contain an array of json snippets". For the devcontainer cli tool this doesn't seem to be an issue but I am using envbuilder to run my containers and if the metadata isn't a list it will cause envbuilder to crash. Based off the website I think it's fair to assume that it should always be a list but it isn't defined very well.

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