Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Proposal] Expose the container name in remoteEnv

Aperta
#778 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker, docker-compose

Direzione di ricerca

This is a specification proposal, so there are no code files yet; the relevant text is the remoteEnv and variable-substitution sections of the devcontainer.json spec. Read the related issues linked in the body (spec #184 and #692) to see what has already been decided about container naming. Done means a written proposal that defines when ${containerName} is resolved, covers Docker Compose primary services, and is discussed by maintainers.

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

Descrizione

A process running in a devcontainer may need its container’s runtime name for logging or tracking purposes. Today, there is no way to reference that name in remoteEnv. The name field in devcontainer.json is a display name and may differ from the name shown by Docker or Podman.

Add a ${containerName} variable that can be used in remoteEnv:

{
  "remoteEnv": {
    "DEVCONTAINER_CONTAINER_NAME": "${containerName}"
  }
}

${containerName} should resolve to the actual runtime name of the primary development container. It should work for both newly created and reused containers, including the primary service in a Docker Compose setup. The tool should resolve it before running lifecycle commands or starting other processes to which remoteEnv applies.

This does not change how containers are named. Because the value is only known after container creation, ${containerName} would not be available in creation-time settings such as containerEnv or runArgs.

Related requests: container name in devcontainer.json (https://github.com/devcontainers/spec/issues/184) and a CLI option to choose the name (https://github.com/devcontainers/spec/issues/692).

Lingua principale
Nessun dato sulla lingua
Stelle
5.8k
Fork
503
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di devcontainers/spec

Tutte le issue di devcontainers/spec

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.