up hangs after compose up -d on a cold start (Node 26, Compose 5.6)

Aperta
#1,354 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@v-Kaniska244 ci sta già lavorando.

Dal 9/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
docker-compose, node.js, typescript
Ambito
cli, devtools

Direzione di ricerca

Start by tracing the Docker events watcher around the startEventSeen log and the Compose up -d call described in the report; compare the cold start with the already-running container case. The report includes a minimal Compose configuration and a trace log, but no source files or tests. Done means identifying and fixing the hang so devcontainer up runs lifecycle commands and returns its JSON result on a cold start.

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

Descrizione

devcontainer up hangs on a cold start of a Docker Compose config: docker compose … up -d finishes in about 2 s, the CLI logs startEventSeen for the container, and then nothing happens until it is killed. Lifecycle commands never run, although the container is up. VS Code's Dev Containers extension (0.469.0) brings up the same config fine, and devcontainer up against a container that is already running succeeds in about 1 s.

Minimal repro

.devcontainer/devcontainer.json:

{ "dockerComposeFile": "docker-compose.yml", "service": "devcontainer", "workspaceFolder": "/workspace", "remoteUser": "node", "postCreateCommand": "echo POSTCREATE_RAN" }

.devcontainer/docker-compose.yml:

name: minimaltest
services:
  devcontainer:
    image: node:24-trixie-slim
    command: sleep infinity
    volumes:
      - ..:/workspace
npx @devcontainers/[email protected] up --workspace-folder . --log-level trace

Expected: POSTCREATE_RAN and the JSON result.
Actual: the last line logged is Stop (1307 ms): Run: docker compose … up -d, and it hangs there. It hung on every cold start: 3 runs, killed after 3, 5 and 15 minutes.

Environment
  • @devcontainers/cli 0.80.0, through npx
  • Node v26.7.0
  • Docker Compose 5.6.1
  • Linux 7.3.0 x64 (CachyOS)

Not yet ruled out: Node 26. I haven't managed to run it on Node 24 yet. My guess, untested, is the CLI's Docker events watcher with Node 26 or Compose 5.6. I'll add a comment with the Node 24 result.

End of the trace log (minimal repro)
    image: node:24-trixie-slim
    networks:
      default: null
    volumes:
      - type: bind
        source: /tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal
        target: /workspace
        bind: {}
networks:
  default:
    name: minimaltest_default
[2026-11-08T08:05:42.078Z] Start: Run: docker inspect --type image node:24-trixie-slim
[2026-11-08T08:05:42.286Z] Stop (208 ms): Run: docker inspect --type image node:24-trixie-slim
[2026-11-08T08:05:42.289Z] workspace root: /tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal
[2026-11-08T08:05:42.289Z] No user features to update
[2026-11-08T08:05:42.290Z] Start: Run: docker compose --project-name minimaltest -f /tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/docker-compose.yml build
[2026-11-08T08:05:42.402Z] time="2026-11-08T08:05:42Z" level=warning msg="No services to build"

[2026-11-08T08:05:42.405Z] Stop (115 ms): Run: docker compose --project-name minimaltest -f /tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/docker-compose.yml build
[2026-11-08T08:05:42.407Z] Start: Run: docker inspect --type image node:24-trixie-slim
[2026-11-08T08:05:42.496Z] Stop (89 ms): Run: docker inspect --type image node:24-trixie-slim
[2026-11-08T08:05:42.499Z] Start: Run: docker build -f /tmp/devcontainercli-das974/updateUID.Dockerfile-0.80.0 -t vsc-minimal-7518ba447e9e4c65ca58398059df89903e42653d645ad30a20ae3704cc36c446-uid --platform linux/amd64 --build-arg BASE_IMAGE=node:24-trixie-slim --build-arg REMOTE_USER=node --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /tmp/devcontainercli-das974/empty-folder
[2026-11-08T08:05:44.573Z] Stop (2074 ms): Run: docker build -f /tmp/devcontainercli-das974/updateUID.Dockerfile-0.80.0 -t vsc-minimal-7518ba447e9e4c65ca58398059df89903e42653d645ad30a20ae3704cc36c446-uid --platform linux/amd64 --build-arg BASE_IMAGE=node:24-trixie-slim --build-arg REMOTE_USER=node --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /tmp/devcontainercli-das974/empty-folder
[2026-11-08T08:05:44.576Z] Docker Compose override file for creating container:
services:
  'devcontainer':
    image: vsc-minimal-7518ba447e9e4c65ca58398059df89903e42653d645ad30a20ae3704cc36c446-uid
    entrypoint: ["/bin/sh", "-c", "echo Container started\n
trap \"exit 0\" 15\n
\n
exec \"$$@\"\n
while sleep 1 & wait $$!; do :; done", "-", "docker-entrypoint.sh"]
    labels:
      - 'devcontainer.local_folder=/tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal'
      - 'devcontainer.config_file=/tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/devcontainer.json'
      - 'devcontainer.metadata=[{"postCreateCommand":"echo POSTCREATE_RAN","remoteUser":"node"}]'
[2026-11-08T08:05:44.576Z] Writing docker-compose.devcontainer.containerFeatures-1794125144576-9e5c278e-ae92-4f11-9449-df64dcedccd1.yml to /tmp/devcontainercli-das974/docker-compose
[2026-11-08T08:05:44.577Z] Start: Run: docker compose --project-name minimaltest -f /tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/docker-compose.yml -f /tmp/devcontainercli-das974/docker-compose/docker-compose.devcontainer.containerFeatures-1794125144576-9e5c278e-ae92-4f11-9449-df64dcedccd1.yml up -d
[2026-11-08T08:05:45.878Z] Log: startEventSeen#data {"Type":"container","Action":"start","Actor":{"ID":"db5ae743ecd155a214ea2330dbe7414ff837bb7f96b98634ee913aab9223c9f0","Attributes":{"com.docker.compose.config-hash":"b72885f6d91e260cf6a7f37c403f9e96f393975a1a4ae4e98baf9696888dab0f","com.docker.compose.container-number":"1","com.docker.compose.depends_on":"","com.docker.compose.image":"sha256:4fe7a777e0aa8b1e5721fcc4f0490ad5d12577fa6e0e843d4326315644642f8e","com.docker.compose.oneoff":"False","com.docker.compose.project":"minimaltest","com.docker.compose.project.config_files":"/tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/docker-compose.yml,/tmp/devcontainercli-das974/docker-compose/docker-compose.devcontainer.containerFeatures-1794125144576-9e5c278e-ae92-4f11-9449-df64dcedccd1.yml","com.docker.compose.project.working_dir":"/tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer","com.docker.compose.service":"devcontainer","com.docker.compose.version":"5.6.1","devcontainer.config_file":"/tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/devcontainer.json","devcontainer.local_folder":"/tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal","devcontainer.metadata":"[{\"postCreateCommand\":\"echo POSTCREATE_RAN\",\"remoteUser\":\"node\"}]","image":"vsc-minimal-7518ba447e9e4c65ca58398059df89903e42653d645ad30a20ae3704cc36c446-uid","name":"minimaltest-devcontainer-1"}},"scope":"local","time":1794125145,"timeNano":1794125145877240315}
[2026-11-08T08:05:45.884Z] Stop (1307 ms): Run: docker compose --project-name minimaltest -f /tmp/claude-1000/-data-das974-typesmiths-hockey/50c8e17a-c525-45a6-94b5-bea4641c970f/scratchpad/repro/minimal/.devcontainer/docker-compose.yml -f /tmp/devcontainercli-das974/docker-compose/docker-compose.devcontainer.containerFeatures-1794125144576-9e5c278e-ae92-4f11-9449-df64dcedccd1.yml up -d
Lingua principale
TypeScript
Stelle
3k
Fork
473
Merge medio
10h 31m
PR unite (30g)
9

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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/cli

Tutte le issue di devcontainers/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.