Skip to content

Installing a dev container feature more than once in a devcontainer.json #44

Open
@joshspicer

Description

@joshspicer

The current dev container features specification proposal is based on an array-like syntax for the 'features' attribute, and thus allows for the invocation of a single feature >1 with different options.

An execution goal stated in the spec is that

"It should be possible to execute a feature multiple times with different parameters."

We are currently discussing how best to tackle feature installation order (#43), with the discussion leaning toward proceeding without use of an array, meaning that there is a need to explore other mechanisms for invoking a feature to install >1 times.

Proposal

The propose extending the value to include an array of objects.

{
    "image": "azcr.io/joshspicer/my-docker-image",
    "features": {
        "devcontainers/features/dotnet": [
            {
              "version": 3.1,
              "runtimeOnly": true,
              "installUsingApt": true
            },
            {
              "version": 6.0,
              "runtimeOnly": false,
              "installUsingApt": false
            }
        ]
    }
}

This devcontainer.json will invoke the devcontainers/features/dotnet feature twice with two sets of options in order (first with the 3.1 set of arguments, and then 6.0 set of arguments).

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalStill under discussion, collecting feedback

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions