当 docker build 需要更多时间时,VSCode devcontainer 会失败

当 docker build 需要更多时间时,VSCode devcontainer 会失败

我对 devcontainer 有一些问题。

我的设置很简单,.devcontainer文件夹包含devcontainer.json

{
    "name": "Ubuntu",
    "build": {
        "dockerfile": "Dockerfile"
    },
    "extensions": [ "nadako.vshaxe" ],
    "forwardPorts": [ 3000 ],
    "remoteUser": "vscode"
}

Dockerfile

FROM haxe:4.2-bullseye

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN groupadd --gid $USER_GID $USERNAME && \
    useradd \
      --uid ${USER_UID} \
      --gid ${USER_GID} \
      --create-home \
      --shell /bin/bash \
      ${USERNAME}

RUN apt-get upgrade && \
    apt-get update

RUN haxelib setup ~/haxelib && \
    haxelib install lime && \
    haxelib install openfl


CMD ["sh", "-c"]

但是它不能正常工作: 工作区被破坏

此外,我无法获取任何日志,因为尝试打开终端导致

The terminal process failed to launch: Starting directory (cwd) "/workspaces/e9d1a4e0e6c117e14accaa9eff92c0d10446e1eb5f284b3c9438541c20734591" does not exist.

相关内容