2

我在 Ubuntu 18.04 上的 VS Code(版本 1.35.0)上使用远程容器扩展(版本 0.59.0),mycustomimage-id当我单击远程容器时出现以下错误(我删除了 的图像 ID):重新打开文件夹在容器中

Setting up container for folder: /home/user/source/project
Run: docker exec mycustomimage-id test -d /root/.vscode-server
cannot exec in a stopped state: unknown
Run: docker exec mycustomimage-id test -d /root/.vscode-remote
Error response from daemon: Container mycustomimage-id is not running
Run: docker exec mycustomimage-id /bin/sh -c set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
Error response from daemon: Container mycustomimage-id is not running
Run: docker exec mycustomimage-id /bin/sh -c (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
Error response from daemon: Container mycustomimage-id is not running
Run: docker exec mycustomimage-id test -d /root/.vscode-server/bin/553cfb2c2205db5f15f3ee8395bbd5cf066d357d
Error response from daemon: Container mycustomimage-id is not running
Installing VS Code Server for commit 553cfb2c2205db5f15f3ee8395bbd5cf066d357d
Run: docker exec mycustomimage-id mkdir -p /root/.vscode-server/bin/553cfb2c2205db5f15f3ee8395bbd5cf066d357d_1560180323972
Error response from daemon: Container mycustomimage-id is not running

devcontainer.json的如下:

// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
    "name": "Load image",
    "context": "..",
    "image": "mycustomimage:20190531",
    "runArgs": [    
        "--cap-add=SYS_PTRACE",
        "--security-opt",
        "seccomp=unconfined",
        "-e", "REPO_TOKEN=${env.REPO_TOKEN}",
        "-e", "BUILD_CONFIGURATION=Debug",
        "--entrypoint","/bin/bash"
    ],

    "extensions": ["ms-vscode.cpptools"],
    "workspaceFolder": "/src/remoteproj",
    "workspaceMount": "source=/home/user/source/project,destination=/src/remoteproj,type=bind"  
}

我已经尝试过使用正在运行的容器以及当我没有任何正在运行的容器时。如何确保 devcontainer.json 中引用的图像与 VS Code 尝试启动的图像相同?

4

0 回答 0