Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

unable to start container process: can't get final child's PID from pipe: EOF: unknown

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
docker, docker-compose, go, postgres

调研方向

首先检查 .devcontainer/devcontainer.json、docker-compose.yaml、Dockerfile 和 .env,然后使用报告中的 Docker Compose 命令重现故障。检查 runc PID 错误附近的 Docker daemon 输出,并比较 app 和 db 服务的配置。当 Codespace 成功创建并启动两个容器时,即表示完成。

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

描述

Hello,

I've made no update to my repo for a few months, however I am getting an error with the codespace start up

[?25hError response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: can't get final child's PID from pipe: EOF: unknown
2025-11-10 21:14:08.510Z: Stop: Run: docker compose --project-name movie-rating_devcontainer -f /var/lib/docker/codespacemount/workspace/movie-rating/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.build-1762809130202.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.containerFeatures-1762809234636-8bcbae83-6361-46e9-9b24-5b0bf663efd4.yml up -d
2025-11-10 21:14:08.512Z: Error: Command failed: docker compose --project-name movie-rating_devcontainer -f /var/lib/docker/codespacemount/workspace/movie-rating/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.build-1762809130202.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.containerFeatures-1762809234636-8bcbae83-6361-46e9-9b24-5b0bf663efd4.yml up -d
2025-11-10 21:14:08.513Z:     at l6 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:432:3348)
2025-11-10 21:14:08.513Z:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-11-10 21:14:08.513Z: {"outcome":"error","message":"Command failed: docker compose --project-name movie-rating_devcontainer -f /var/lib/docker/codespacemount/workspace/movie-rating/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.build-1762809130202.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.containerFeatures-1762809234636-8bcbae83-6361-46e9-9b24-5b0bf663efd4.yml up -d","description":"An error occurred starting Docker Compose up."}
2025-11-10 21:14:08.514Z:     at async c6 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:412:3860)
2025-11-10 21:14:08.514Z:     at async Y6 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:4015)
2025-11-10 21:14:08.514Z:     at async BC (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:4957)
2025-11-10 21:14:08.515Z:     at async p7 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:665:202)
2025-11-10 21:14:08.515Z:     at async d7 (/.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:664:14804)
2025-11-10 21:14:08.516Z:     at async /.codespaces/agent/bin/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:1188
2025-11-10 21:14:08.526Z: devcontainer process exited with exit code 1

====================================== ERROR ====================================
2025-11-10 21:14:08.614Z: Failed to create container.
=================================================================================
2025-11-10 21:14:08.615Z: Error: Command failed: docker compose --project-name movie-rating_devcontainer -f /var/lib/docker/codespacemount/workspace/movie-rating/.devcontainer/docker-compose.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose.codespaces.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.build-1762809130202.yml -f /var/lib/docker/codespacemount/.persistedshare/docker-compose/docker-compose.devcontainer.containerFeatures-1762809234636-8bcbae83-6361-46e9-9b24-5b0bf663efd4.yml up -d
2025-11-10 21:14:08.619Z: Error code: 1302 (UnifiedContainersErrorFatalCreatingContainer)

My repo is set up with

.devcontainer
| .env
| devcontainer.json
| docker-compose.yaml
| Dockerfile

Here are the following:
.env

POSTGRES_USER=postgres
POSTGRES_PASSWORD=docker
POSTGRES_DB=postgres
POSTGRES_HOSTNAME=localhost

devcontainer.json

{
	"name": "Movie Rating",
	"dockerComposeFile": "docker-compose.yml",
	"service": "app",
	"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
	"customizations": {
		"vscode": {
			"extensions": [
				"streetsidesoftware.code-spell-checker",
				"golang.go",
				"ms-azuretools.vscode-docker"
			]
		}
	},
	"hostRequirements": {
		"cpus": 4,
		"memory": "16gb"
	}
}

docker-compose.yaml

version: '3.8'

volumes:
  postgres-data:

services:
  app:
    build: 
      context: .
      dockerfile: Dockerfile
    env_file:
        # Ensure that the variables in .env match the same variables in devcontainer.json
        - .env

    volumes:
      - ../..:/workspaces:cached
      
    # Overrides default command so things don't shut down after the process ends.
    command: sleep infinity

    # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
    network_mode: service:db

    # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. 
    # (Adding the "ports" property to this file will not forward from a Codespace.)

  db:
    image: postgres:latest
    restart: unless-stopped
    volumes:
      - postgres-data:/var/lib/postgresql/data
    env_file:
      # Ensure that the variables in .env match the same variables in devcontainer.json
      - .env


Dockerfile

FROM mcr.microsoft.com/devcontainers/go:1-1.24-bookworm


# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && apt-get -y install --no-install-recommends nodejs git npm jq apt-utils dialog dnsutils httpie wget unzip curl

I see a merge on go/ go-postgres but don't think this is related https://github.com/devcontainers/templates/pull/362

主要语言
Shell
星标
1.4k
派生
393
平均合并
5 天 5 小时
30 天内合并 PR
4

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

devcontainers/templates 的其他 Issue

查看 devcontainers/templates 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

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