dev container build시 ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF 에러 해결

2023. 2. 6. 16:03카테고리 없음

728x90

2월 초쯤 dev container로 build 시(Rebuild 포함)

 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04                                                                                                0.0s
 => CACHED [dev_container_auto_added_stage_label 1/1] FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04                                                                      0.0s
 => preparing layers for inline cache                                                                                                                                                    0.0s
ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF
[2983 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-ubuntu/container-features/0.29.0-1675578910662/Dockerfile-with-features -t vsc-works-6d0a37a4ea0c9917ccb026d321f053f0 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /home/ubuntu/works/.devcontainer
[2984 ms]     at pie (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:1916:1698)
[2984 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2984 ms]     at async vF (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:1915:1972)
[2984 ms]     at async P7 (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:1915:901)
[2984 ms]     at async Fie (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:1921:2093)
[2984 ms]     at async Vf (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:1921:3241)
[2985 ms]     at async eoe (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:2045:17324)
[2985 ms]     at async Qse (/home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js:2045:17065)
[2987 ms] Exit code 1
[2990 ms] Command failed: /home/ubuntu/.vscode-server/bin/e2816fe719a4026ffa1ee0189dc89bdfdbafb164/node /home/ubuntu/.vscode-remote-containers/dist/dev-containers-cli-0.275.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder tmp/devcontainers-6793a615-b34c-4b91-8989-cf7bc6a14e4f1675578908116 --workspace-folder /home/ubuntu/works --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/ubuntu/works --id-label devcontainer.config_file=/home/ubuntu/works/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/ubuntu/works/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true --terminal-columns 190 --terminal-rows 46

 

위와 같은 에러가 났다.

나는 기존에 검증이 끝난 devcontainer파일이라 에러가 난다면 Dockerfile에서 설치 시 설치하는 프로그램 간에 version문제로 인한 충돌이 나지 않은 이상 에러날 상황이 없기 때문에 해결하기 위해 인터넷 서핑을 하던 도중 이와 같은 글을 발견했다.

https://github.com/microsoft/vscode-remote-release/issues/7958

 

[Container] Fail to build a devcontainer: ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading fr

VSCode Version: 1.75 Local OS Version: Fedora 37 Remote OS Version: Fedora 37 Remote Extension/Connection Type: Containers Logs: [2023-02-03T08:26:11.196Z] Dev Containers 0.276.0 in VS Code 1.75.0 ...

github.com

해결방법은 여러 가지가 있지만 나는 

  "build": {
    "dockerfile": "Dockerfile",
    "cacheFrom": "brewblox/firmware-devcontainer:bullseye",
    "args": {
      "USERNAME": "vscode",
      "BUILDKIT_INLINE_CACHE": "0"
    }
  },

위와 같은 방법으로 devcontainer.json 파일에 "BUILDKIT_INLINE_CACHE" : "0" 추가로 해결했다.

추후 더 좋은 방법이 있다면 바꾸는 게 좋겠다.