devcontainers / devcontainers/spec

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

Aperta
#44 20 commenti 14 reazioni 0 assegnatari Vedi su GitHub
proposal
Lingua principale
Nessun dato sulla lingua
Stelle
5.7k
Fork
496
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The current [dev container features specification proposal](https://github.com/devcontainers/spec/blob/main/proposals/devcontainer-features.md#execution) 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)](https://github.com/devcontainers/spec/issues/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](https://github.com/devcontainers/cli/blob/main/src/spec-configuration/containerFeaturesConfiguration.ts#L33) to include an array of objects.

```jsonc
{
"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).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Read the execution section of the dev container features specification proposal and the linked src/spec-configuration/containerFeaturesConfiguration.ts definition first; compare them with the ordering discussion in issue #43. Define an agreed representation that permits repeated feature installations with distinct options in order, and confirm that the specification and configuration type describe the same behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.