devcontainers / devcontainers/spec

Image buildx CLI arguments

Offen
#85 9 Kommentare 14 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
proposal
Vorherrschende Sprache
Keine Sprachdaten
Sterne
5.7k
Forks
498
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Related to #74 and #18, as devcontainer.json drives builds for images that are self-contained there is an increasing likelihood for developers to need to be able to apply build time arguments not supported directly by the dev container CLI.

https://github.com/microsoft/vscode-remote-release/issues/3545 has continued to gain up-votes and has several examples of this problem:

- ` --ssh=default`
- `--add-host=archive.ubuntu.com:160.26.2.187`
- `--network=host`

The common theme here is network access for the build itself. One option is to try to adopt all of these types of arguments under the `build` property, but there's a risk of always being out of date. Other examples include:

- Specifying a custom builder (for buildx)
- Allowing extra privileges for just the build
- Passing in secrets (via `--secret`)

People are going so far as to use `initalizeCommand` to do the build instead of using built in support due to these gaps.

While `secret` in particular could be added to the spec, we likely need a "safety valve". Therefore, I'd propose we include a `build.cliArgs` property. similar to `runArgs`, but focused on the CLI arguments of buildx instead.

```json
{
"build": {
"dockerfile": "Dockerfile",
"args": {
"foo": "bar"
},
"cliArgs": [ "--ssh=default" ]
}
}
```
Popular arguments should be moved into the spec itself (like #2 for runArgs), but this provides an interim solution and a way to handle less common scenarios.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der vorgeschlagenen Build-Eigenschaft und vergleichen Sie die zugehörigen Issues #74 und #18 sowie die aufgeführten buildx-Argumentbeispiele. Bestimmen Sie den vorgesehenen Umfang und das Sicherheitsverhalten für eine build.cliArgs-Eigenschaft; abgeschlossen ist die Aufgabe, wenn die Spezifikation ihr Format und ihre Verarbeitung klar genug definiert, um die Beispiele abzudecken, ohne initializeCommand zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker
Bereich
build-system, devops
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.