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

未关闭
#1,354 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@v-Kaniska244 已经在做这个了。

开始于 2026年11月9日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker-compose, node.js, typescript
领域
cli, devtools

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
3k
派生
473
平均合并
10 小时 31 分钟
30 天内合并 PR
9

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

devcontainers/cli 的其他 Issue

查看 devcontainers/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。