I could create dev containers all fine before i updated my windows. Now
whenever i try to create a new remote connection on docker using vs code Dev Containers, i get this error
[6194 ms] Error: Command failed: docker-compose --project-name devhachchukanrijwlcjp_devcontainer -f c:\Users\bei20\ドキュメント\dev.hachchukanri.jwlc.jp\.devcontainer\docker-compose.yml -f c:\Users\bei20\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data\docker-compose\docker-compose.devcontainer.build-1675247768363.yml build
[6194 ms] at hF (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1822:412)
[6194 ms] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[6194 ms] at async Une (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1822:2381)
[6195 ms] at async jne (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1804:2396)
[6195 ms] at async oie (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1871:2266)
[6195 ms] at async qf (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1871:3239)
[6195 ms] at async Mse (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1995:16211)
[6195 ms] at async Lse (c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js:1995:15965)
[6210 ms] Exit code 1
[6215 ms] Command failed: C:\Users\bei20\AppData\Local\Programs\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\bei20\.vscode\extensions\ms-vscode-remote.remote-containers-0.269.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\bei20\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\bei20\ドキュメント\dev.hachchukanri.jwlc.jp --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\bei20\ドキュメント\dev.hachchukanri.jwlc.jp --log-level debug --log-format json --config c:\Users\bei20\ドキュメント\dev.hachchukanri.jwlc.jp\.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
[6216 ms] Exit code 1
what could this be? im so close to resetting my pc but im afraid even that wont solve it! please help. thanks.
Related
When testing a minimal dev container with multistage build it fails when using "scratch".
My system:
Windows 11
Docker desktop 4.3.2
WSL Ubuntu 20.04
VS-Code v1.74.3
Docker extension v1.23.3
Dev Containers extension v0.266.1
in .devcontainer.json just call Dockerfile:
{
"build": {
"dockerfile": "Dockerfile"
}
}
Dockerfile:
FROM mcr.microsoft.com/vscode/devcontainers/base:bionic as base
FROM scratch as final
COPY --from=base / /
CMD [ "/bin/sh" ]
In VS Code -> F1 -> Reopen in container
Log output:
[1170076 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[1170321 ms] 1.41
[1170410 ms] Start: Run: C:\Program Files\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\thorgrim\.vscode\extensions\ms-vscode-remote.remote-containers-0.266.1\dist\spec-node\devContainersSpecCLI.js read-configuration --workspace-folder c:\Users\thorgrim\Wago Norge Dropbox\Thorgrim Jansrud\AT_WORK\GitHub\dev-container-docker-desktop-howto --log-level debug --log-format json --config c:\Users\thorgrim\Wago Norge Dropbox\Thorgrim Jansrud\AT_WORK\GitHub\dev-container-docker-desktop-howto\.devcontainer\devcontainer.json --include-merged-configuration --mount-workspace-git-root true
[1170689 ms] (node:15500) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1170689 ms] (Use `Code --trace-deprecation ...` to show where the warning was created)
[1170693 ms] #devcontainers/cli 0.25.2. Node.js v16.14.2. win32 10.0.22000 x64.
[1170693 ms] Start: Run: git rev-parse --show-cdup
[1170747 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=c:\Users\thorgrim\Wago Norge Dropbox\Thorgrim Jansrud\AT_WORK\GitHub\dev-container-docker-desktop-howto
[1171060 ms] Start: Run: docker inspect --type image scratch
[1178824 ms] Error fetching image details: No manifest found for docker.io/library/scratch.
[1178824 ms] Start: Run: docker pull scratch
Using default tag: latest
Error response from daemon: 'scratch' is a reserved name
[1179391 ms] []
[1179391 ms] Error: No such image: scratch
[1179391 ms] Command failed: docker inspect --type image scratch
[1179402 ms] Exit code 1
What works as a workaround is:
building with the vs code docker extension -> right click Dockerfile -> build image.
manually by cli -> Docker build .
Cant figure out why the dev container extension does not build this image correct when using "FROM scratch" as second stage. Other images works (e.g. FROM base) but I know the "From scratch" is not a real image that can be pulled..
As I don't have access to Github Codespaces and I'm not the type of person to pay for Github Teams only for this... is it possible to run mcr.microsoft.com/vscode/devcontainers/universal:2.0.9-linux locally with docker?
I tried to use steps in https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux to copy .devcontainer folder to my project folder, but when I try to use Remote-Containers: Reopen Folder in Container it stops with error:
[2022-09-05T22:07:51.999Z] Stop (218 ms): Run: docker inspect --type container 2e252fbefb8fa27f8e4d527747cb5da095103cd894f904fd94004f0fdbc8df93
[2022-09-05T22:07:51.999Z] Stop (218 ms): Inspecting container
[2022-09-05T22:07:51.999Z] Start: Run in container: /bin/sh
[2022-09-05T22:07:52.002Z] Start: Run in container: uname -m
[2022-09-05T22:07:52.016Z] Stop (17 ms): Run in container: /bin/sh
[2022-09-05T22:07:52.016Z] Shell server terminated (code: 1, signal: null)
[2022-09-05T22:07:52.016Z] Error response from daemon: Container 2e252fbefb8fa27f8e4d527747cb5da095103cd894f904fd94004f0fdbc8df93 is not running
[2022-09-05T22:07:52.016Z] Start: Run in container: cat /etc/passwd
[2022-09-05T22:07:52.016Z] Stdin closed!
[2022-09-05T22:07:52.017Z] Error: An error occurred setting up the container.
[2022-09-05T22:07:52.017Z] at SF (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:257:2186)
[2022-09-05T22:07:52.017Z] at pb (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:257:2124)
[2022-09-05T22:07:52.017Z] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-09-05T22:07:52.017Z] at async DF (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:263:2006)
[2022-09-05T22:07:52.017Z] at async to (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:263:3110)
[2022-09-05T22:07:52.017Z] at async Ak (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:383:8108)
[2022-09-05T22:07:52.018Z] at async Ok (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:383:7864)
[2022-09-05T22:07:52.021Z] Stop (736 ms): Run: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/randomperson/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/randomperson/Documents/Github/Bob --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/randomperson/Documents/Github/Bob --log-level debug --log-format json --config /home/randomperson/Documents/Github/Bob/.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
[2022-09-05T22:07:52.021Z] Exit code 1
[2022-09-05T22:07:52.025Z] Command failed: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/randomperson/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/randomperson/Documents/Github/Bob --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/randomperson/Documents/Github/Bob --log-level debug --log-format json --config /home/randomperson/Documents/Github/Bob/.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
[2022-09-05T22:07:52.025Z] Exit code 1
Is there maybe an image with a specific tag that can be self-hosted or my machine is just too slow for this.
I am trying to run a dev container on my vsode for ruby on rails, however, I cannot and getting the following error:
[2022-07-14T15:35:08.995Z] ERROR: Version mismatch: file /home/parham/projects/ruby/.devcontainer/docker-compose.yml specifies version 2.4 but extension file /tmp/docker-compose/docker-compose.devcontainer.build-1657812908036.yml uses version 1
[2022-07-14T15:35:09.136Z] Stop (1097 ms): Run: docker-compose --project-name ruby_devcontainer -f /home/parham/projects/ruby/.devcontainer/docker-compose.yml -f /tmp/docker-compose/docker-compose.devcontainer.build-1657812908036.yml build
[2022-07-14T15:35:09.669Z] Error: Command failed: docker-compose --project-name ruby_devcontainer -f /home/parham/projects/ruby/.devcontainer/docker-compose.yml -f /tmp/docker-compose/docker-compose.devcontainer.build-1657812908036.yml build
[2022-07-14T15:35:09.669Z] at Uu (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:204:419)
[2022-07-14T15:35:09.669Z] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-07-14T15:35:09.670Z] at async kR (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:204:2335)
[2022-07-14T15:35:09.670Z] at async DR (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:188:2228)
[2022-07-14T15:35:09.670Z] at async QR (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:245:2177)
[2022-07-14T15:35:09.670Z] at async cb (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:245:3110)
[2022-07-14T15:35:09.670Z] at async i_ (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:245:13194)
[2022-07-14T15:35:09.670Z] at async n_ (/home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js:245:12950)
[2022-07-14T15:35:09.682Z] Stop (6372 ms): Run in Host: /home/parham/.vscode-server/bin/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/node /home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/parham/projects/ruby --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/parham/projects/ruby --log-level debug --log-format json --config /home/parham/projects/ruby/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-07-14T15:35:09.684Z] Exit code 1
[2022-07-14T15:35:09.689Z] Command failed: /home/parham/.vscode-server/bin/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/node /home/parham/.vscode-remote-containers/dist/dev-containers-cli-0.241.3/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/parham/projects/ruby --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/parham/projects/ruby --log-level debug --log-format json --config /home/parham/projects/ruby/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-07-14T15:35:09.689Z] Exit code 1
UPDATE
This is my .devcotnainer.json which forwards some ports and they are the only changes that I have added to the code.
{
"name": "Ruby on Rails & Postgres",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": [
"rebornix.Ruby"
]
}
},
"forwardPorts": ["30000:3000", "54320:5432"],
"remoteUser": "vscode",
"features": {
"git": "latest",
"python": "latest"
}
}
If you would like to reproduce select all additional features. That will cause error.
I'm using VSCode Devcontainers to develop a micro-services application and I've been using a Java Devcontainer without issues.
But, given the micro-service nature of the project, there are other containers I need to execute (for instance, a postgres db).
This is the only container I use to develop, where I install Java-specific extensions, intellisense working, etc. I do NOT have this on my local machine nor do I want to have. Only when coding on the container.
Now, I did some research to shift the use of Devcontainers to docker-compose and start not only the Java devcontainer but also the database.
Everything seems to run fine.
However, the dev container will alway exit with code 137 and I can't figure out why.
The structure of the code is as follows:
|.devcontainer
|--devcontainer.json
|--Dockerfile
|--docker-compose.yaml
|.git
|actionable-content
|--(my module code)
|db
|--Dockerfile
|--init.sql
|(...)
This is the output of the containers build commands:
[18 ms] Start: Resolving remote
[20 ms] Setting up container for folder or workspace: /Users/zed/Projects/circle-labs
[39 ms] Start: Check Docker is running
[39 ms] Start: Run: docker info
[401 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=evooq-circle --filter label=com.docker.compose.service=dev-container
[444 ms] Start: Run: docker inspect --type container ea365c78bc6d
[490 ms] Start: Removing existing container.
[490 ms] Start: Run: docker rm -f ea365c78bc6d229737805fe4121324b45c87688ccd369bccebf209689f2658d7
[611 ms] Start: Run: docker-compose -f /Users/zed/Projects/circle-labs/.devcontainer/docker-compose.yaml config --services
[1027 ms] Start: Run: docker events --format {{json .}} --filter status=start
[1032 ms] Start: Run: docker-compose --project-name evooq-circle -f /Users/zed/Projects/circle-labs/.devcontainer/docker-compose.yaml up -d --build db dev-container
Building db
Step 1/2 : FROM postgres:9.6
---> 16f0ba6ed857
Step 2/2 : COPY init.sql /docker-entrypoint-initdb.d/
---> Using cache
---> e90f4e0c7c73
Successfully built e90f4e0c7c73
Successfully tagged evooq-circle_db:latest
Building dev-container
Step 1/15 : FROM openjdk:11-jdk
---> a548e8a50190
Step 2/15 : ARG USERNAME=vscode
---> Using cache
---> bd1352aa5e59
Step 3/15 : ARG USER_UID=1000
---> Using cache
---> 192dca586afc
Step 4/15 : ARG USER_GID=$USER_UID
---> Using cache
---> 91a3124b064c
Step 5/15 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 222b620a3e1b
Step 6/15 : RUN apt-get update && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 && groupadd --gid $USER_GID $USERNAME && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME && apt-get install -y sudo && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && chmod 0440 /etc/sudoers.d/$USERNAME && apt-get -y install git openssh-client less iproute2 procps curl lsb-release
---> Using cache
---> 8ad502a168f4
Step 7/15 : ARG MAVEN_VERSION=3.6.3
---> Using cache
---> 2f0fed0ae029
Step 8/15 : ARG MAVEN_SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
---> Using cache
---> ba172229c081
Step 9/15 : RUN mkdir -p /usr/share/maven /usr/share/maven/ref && curl -fsSL -o /tmp/apache-maven.tar.gz https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz && echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && rm -f /tmp/apache-maven.tar.gz && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
---> Using cache
---> 033989c61d1f
Step 10/15 : COPY maven-settings.xml /usr/share/maven/ref/
---> Using cache
---> 5dcb163d3198
Step 11/15 : ENV MAVEN_HOME /usr/share/maven
---> Using cache
---> 9c21dcb2fa42
Step 12/15 : ENV MAVEN_CONFIG /root/.m2
---> Using cache
---> 56960418c145
Step 13/15 : RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 939839f8b869
Step 14/15 : ENV DEBIAN_FRONTEND=dialog
---> Using cache
---> da8ceada8e6f
Step 15/15 : RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi
---> Using cache
---> 8781e2f051b0
Successfully built 8781e2f051b0
Successfully tagged evooq-circle_dev-container:latest
evooq-circle_db_1 is up-to-date
Creating evooq-circle_dev-container_1 ... done
[2449 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=evooq-circle --filter label=com.docker.compose.service=dev-container
[2507 ms] Start: Run: docker inspect --type container f11a0e8f78c2
[2555 ms] Start: Inspecting container
[2555 ms] Start: Run: docker inspect --type container f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49
[2609 ms] Start: Run: docker exec -i -u root -e VSCODE_REMOTE_CONTAINERS_SESSION=190e175e-f482-4554-aaf4-e062c672fcdb1593105541203 f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 /bin/sh
[2614 ms] Start: Run in container: uname -m
[2753 ms] x86_64
[2753 ms]
[2753 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[2761 ms] PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[2761 ms]
[2761 ms] Start: Run in container: cat /etc/passwd
[2765 ms] Start: Updating configuration state
[2770 ms] Start: Setup shutdown monitor
[2773 ms] Forking shutdown monitor: /Users/zed/.vscode/extensions/ms-vscode-remote.remote-containers-0.122.1/dist/shutdownMonitorProcess /var/folders/bp/bjk1_4fs2ljdx8pflq89nd500000gn/T/vscode-remote-containers-e8ace0f38179417fa6822e6d83141fd504155ae0.sock dockerCompose Info /Users/zed/Library/Application Support/Code/logs/20200625T091545/exthost3/ms-vscode-remote.remote-containers
[2779 ms] Start: Run in container: test -d /root/.vscode-server
[2785 ms]
[2785 ms]
[2785 ms] Exit code 1
[2785 ms] Start: Run in container: test -d /root/.vscode-remote
[2788 ms]
[2788 ms]
[2788 ms] Exit code 1
[2788 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2797 ms]
[2797 ms]
[2797 ms] Start: Run in container: mkdir -p '/root/.vscode-server/data/Machine' && cat >'/root/.vscode-server/data/Machine/settings.json' <<'settingsJSON'
[2804 ms]
[2804 ms]
[2804 ms] Start: Run in container: test -d /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[2806 ms]
[2806 ms]
[2806 ms] Exit code 1
[2807 ms] Installing VS Code Server for commit cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[2807 ms] Start: Run in container: mkdir -p /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d_1593105545145
[2811 ms]
[2811 ms]
[2812 ms] Start: Run: docker exec -i -u root -w /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d_1593105545145 f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 tar --no-same-owner -xz --strip-components 1
[5305 ms]
[5306 ms]
[5306 ms] Start: Run in container: mv -n /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d_1593105545145 /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[5317 ms]
[5317 ms]
[5317 ms] Start: Launching Remote-Containers helper.
[5318 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[5343 ms] Start: Run in container: gpgconf --list-dir agent-socket
[5348 ms] /root/.gnupg/S.gpg-agent
[5348 ms]
[5348 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
[5356 ms]
[5356 ms]
[5356 ms] Start: Run in container: # Copy /Users/zed/.gitconfig to /root/.gitconfig
[5356 ms] Start: Run: gpgconf --list-dir homedir
[5369 ms]
[5369 ms]
[5369 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-f97cc7a21081e70e2303f2544443a16dbafee09f.js' >/tmp/vscode-remote-containers-f97cc7a21081e70e2303f2544443a16dbafee09f.js
[5382 ms]
[5382 ms]
[5382 ms] Start: Run in container: gpgconf --list-dir homedir
[5401 ms] /root/.gnupg
[5401 ms]
[5401 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/node /tmp/vscode-remote-containers-f97cc7a21081e70e2303f2544443a16dbafee09f.js $*; }; f' || true
[5419 ms]
[5419 ms]
[5420 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-f97cc7a21081e70e2303f2544443a16dbafee09f.js' >/tmp/vscode-remote-containers-server-f97cc7a21081e70e2303f2544443a16dbafee09f.js
[5442 ms]
[5442 ms]
[5443 ms] Start: Run in container: # Copy /Users/zed/.gnupg/pubring.kbx to /root/.gnupg/pubring.kbx
[5445 ms] Start: Run: docker exec -i -u root -e REMOTE_CONTAINERS_SOCKETS=["/tmp/vscode-ssh-auth-f97cc7a21081e70e2303f2544443a16dbafee09f.sock","/root/.gnupg/S.gpg-agent"] -e REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-f97cc7a21081e70e2303f2544443a16dbafee09f.sock f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/node /tmp/vscode-remote-containers-server-f97cc7a21081e70e2303f2544443a16dbafee09f.js
[5482 ms]
[5482 ms]
[5482 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[5494 ms]
[5494 ms]
[5494 ms] Start: Run in container: # Copy /Users/zed/.gnupg/trustdb.gpg to /root/.gnupg/trustdb.gpg
[5529 ms]
[5529 ms]
[5529 ms] Start: Run in container: test -d /root/.vscode-server/extensionsCache && ls /root/.vscode-server/extensionsCache || true
[5530 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[5536 ms]
[5536 ms]
[5539 ms] Start: Run in container: mkdir -p /root/.vscode-server/extensionsCache/tmp-1593105547877
[5553 ms]
[5553 ms]
[5553 ms] Start: Run: docker exec -i -u root -w /root/.vscode-server/extensionsCache/tmp-1593105547877 f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 tar x --strip-components 1
[6353 ms] Start: Run in container: mv /root/.vscode-server/extensionsCache/tmp-1593105547877/* /root/.vscode-server/extensionsCache && rmdir /root/.vscode-server/extensionsCache/tmp-1593105547877
[6393 ms]
[6394 ms]
[6394 ms] Start: Run in container: cd /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d; export VSCODE_AGENT_FOLDER=/root/.vscode-server; /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/server.sh --extensions-download-dir /root/.vscode-server/extensionsCache --install-extension vscjava.vscode-java-pack --install-extension pivotal.vscode-boot-dev-pack --install-extension github.vscode-pull-request-github --install-extension kumar-harsh.graphql-for-vscode --install-extension zxh404.vscode-proto3 --install-extension humao.rest-client --force
[6704 ms] Start: Run in container: ls /root/.vscode-server/extensionsCache
[6704 ms] Stdin closed!
[6706 ms] Shell server terminated (code: 137, signal: null)
[6747 ms] Remote-Containers server terminated (code: 137, signal: null).
I suspect the issue may lie in the extensions installation process, but I'm not entirely sure.
Anyway, I went from this combination of devcontainer.json + Dockerfile here (gist), to the combination of devcontainer.json + docker-compose.yaml + Dockerfile, that are here (another gist).
What could be causing the errors above? I'm really lost here as I don't see a reason.
Also, I suspect I need the runArgs from the initial version but they seem not to be supported when using docker-compose mode.
Thanks
Well, for any of you that end up here looking here, here's what I changed that did the trick:
On my docker-compose.yaml I added the following:
volumes:
# Make the first part whatever your working dir is
- ..:/workspace:cached
- "${HOME}/.ssh:/root/.ssh-localhost:ro"
command: /bin/sh -c "while sleep 1000; do :; done"
On the Dockerfile I added a CMD to the end as well:
CMD [ "sleep", "infinity" ]
Then, rebuild the image, and it should work.
Also, regarding the runArgs, I added this to my docker-compose.yaml file:
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
These additions/modifications should do the trick for you as well
This is the command I always use in any Dockerfile for VSCode:
# Keep container running (for use in VSCode)
CMD [ "tail", "-f", "/dev/null" ]
I have a problem with VS Code remote development. I am using a docker container to isolate my environment. This works on my main machine, but not on my Laptop which I recently set up.
The Laptop stats:
Linux Thinkpad 5.4.7-arch1-1 #1 SMP PREEMPT Tue, 31 Dec 2019 17:20:16 +0000 x86_64 GNU/Linux
I have installed the most recent version of the VS Code binaries (not the open source version) and the extension for remote development.
Now when I try to open a preexisiting project (which works on my main machine) inside a container or try to attach to a running container I get two notifications in vs code and no access to the project files.
Container Build Log
[0 ms] Start: Resolving remote
[1 ms] Setting up container for folder or workspace: /home/philipp/Projects/Ferienwohnung_Walther
[4 ms] Start: Check Docker is running
[33 ms] Start: Run: docker build -f /home/philipp/Projects/Ferienwohnung_Walther/.devcontainer/Dockerfile -t vsc-ferienwohnung_walther-f2cd21b5a0eb18ef2a7ad25ba128b053 /home/philipp/Projects/Ferienwohnung_Walther/.devcontainer
[65 ms] Sending build context to Docker daemon 5.632kB
[102 ms] Step 1/6 : FROM node:lts
[102 ms] ---> 6b5991bf650f
Step 2/6 : ENV DEBIAN_FRONTEND=noninteractive
[102 ms] ---> Using cache
---> 60d927450ba8
Step 3/6 : ARG USER_UID=1000
[103 ms] ---> Using cache
---> 4d5dc4e9421a
Step 4/6 : ARG USER_GID=$USER_UID
[103 ms] ---> Using cache
---> 283c5b3feb04
Step 5/6 : RUN apt-get update && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 && apt-get -y install git iproute2 procps && npm install -g eslint && if [ "$USER_GID" != "1000" ]; then groupmod node --gid $USER_GID; fi && if [ "$USER_UID" != "1000" ]; then usermod --uid $USER_UID node; fi && apt-get install -y sudo && echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node && chmod 0440 /etc/sudoers.d/node && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && npm install -g gatsby-cli && npm install
[104 ms] ---> Using cache
---> ecb1a4bbb610
[104 ms] Step 6/6 : CMD ["bash"]
[104 ms] ---> Using cache
---> 4b40397244fc
[105 ms] Successfully built 4b40397244fc
[113 ms] Successfully tagged vsc-ferienwohnung_walther-f2cd21b5a0eb18ef2a7ad25ba128b053:latest
[118 ms] Start: Run: git rev-parse --show-toplevel
[128 ms] Start: Starting container
[128 ms] Start: Run: docker run -a STDOUT -a STDERR -p 127.0.0.1:8000:8000 --mount type=bind,source=/home/philipp/Projects/Ferienwohnung_Walther,target=/workspaces/Ferienwohnung_Walther,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=/home/philipp/Projects/Ferienwohnung_Walther --entrypoint /bin/sh vsc-ferienwohnung_walther-f2cd21b5a0eb18ef2a7ad25ba128b053 -c echo Container started ; while sleep 1; do :; done
[734 ms] Container started
[745 ms] Start: Inspecting container
[750 ms] Start: Run in container: uname -m
[1005 ms] x86_64
[1005 ms]
[1005 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1006 ms] PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[1006 ms]
[1007 ms] Start: Run in container: cat /etc/passwd
[1008 ms] Start: Updating configuration state
[1009 ms] Start: Setup shutdown monitor
[1011 ms] Forking shutdown monitor: /home/philipp/.vscode/extensions/ms-vscode-remote.remote-containers-0.94.0/dist/shutdownMonitorProcess /run/user/1000/vscode-remote-containers-46e7b8adba2ed8d9f9924860b5b3558d79c7fa06.sock singleContainer Info
[1014 ms] Start: Run in container: test -d /root/.vscode-server
[1015 ms]
[1015 ms]
[1015 ms] Exit code 1
[1015 ms] Start: Run in container: test -d /root/.vscode-remote
[1015 ms]
[1015 ms]
[1015 ms] Exit code 1
[1016 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[1017 ms]
[1017 ms]
[1017 ms] Start: Run in container: mkdir -p '/root/.vscode-server/data/Machine' && cat >'/root/.vscode-server/data/Machine/settings.json' <<'settingsJSON'
[1019 ms]
[1019 ms]
[1019 ms] Start: Run in container: # Copy .gitconfig
[1022 ms]
[1022 ms]
[1023 ms] Start: Run in container: test -d /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0
[1023 ms]
[1023 ms]
[1023 ms] Exit code 1
[1023 ms] Installing VS Code Server for commit 26076a4de974ead31f97692a0d32f90d735645c0
[1023 ms] Start: Run in container: mkdir -p /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0_1578132510402
[1024 ms]
[1024 ms]
[1025 ms] Start: Run: docker exec -w /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0_1578132510402 -u root -i 1a22cf666c2dcc444f05f998b4ce810dfb7c0b505303bb11967a12cabf3b1a3c tar --no-same-owner -xz --strip-components 1
[2130 ms]
[2130 ms]
[2131 ms] Start: Run in container: mv -n /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0_1578132510402 /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0
[2132 ms]
[2132 ms]
[2132 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[2133 ms]
[2133 ms]
[2134 ms] Start: Run in container: cd /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0; export VSCODE_AGENT_FOLDER=/root/.vscode-server; /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/server.sh --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mgmcdermott.vscode-language-babel --install-extension eamodio.gitlens --install-extension gruntfuggly.todo-tree --install-extension esbenp.prettier-vscode --install-extension jpoissonnier.vscode-styled-components --install-extension naumovs.color-highlight --force
[15166 ms] Installing extensions...
Installing extension 'dbaeumer.vscode-eslint' v2.0.11...
Extension 'dbaeumer.vscode-eslint' v2.0.11 was successfully installed.
Installing extension 'formulahendry.auto-rename-tag' v0.1.1...
Extension 'formulahendry.auto-rename-tag' v0.1.1 was successfully installed.
Installing extension 'mgmcdermott.vscode-language-babel' v0.0.25...
Extension 'mgmcdermott.vscode-language-babel' v0.0.25 was successfully installed.
Installing extension 'eamodio.gitlens' v10.2.0...
Extension 'eamodio.gitlens' v10.2.0 was successfully installed.
Installing extension 'gruntfuggly.todo-tree' v0.0.162...
Extension 'gruntfuggly.todo-tree' v0.0.162 was successfully installed.
Installing extension 'esbenp.prettier-vscode' v3.18.0...
Extension 'esbenp.prettier-vscode' v3.18.0 was successfully installed.
Installing extension 'jpoissonnier.vscode-styled-components' v0.0.27...
Extension 'jpoissonnier.vscode-styled-components' v0.0.27 was successfully installed.
Installing extension 'naumovs.color-highlight' v2.3.0...
Extension 'naumovs.color-highlight' v2.3.0 was successfully installed.
[15166 ms]
[15167 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.postCreateCommandMarker' ; } 2> /dev/null
[15168 ms]
[15168 ms]
[15168 ms] Start: Run in container: test -f /root/.vscode-server/.postCreateCommandMarker
[15168 ms]
[15168 ms]
[15168 ms] Exit code 1
[15169 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink -f /proc/$pid/cwd ; xargs -0 < /proc/$pid/environ ; xargs -0 < /proc/$pid/cmdline ; } ; echo ; done 2>/dev/null
[15181 ms] Start: Run: docker exec -w /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0 -u root -e SHELL=/bin/bash -e VSCODE_AGENT_FOLDER=/root/.vscode-server 1a22cf666c2dcc444f05f998b4ce810dfb7c0b505303bb11967a12cabf3b1a3c /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/server.sh --disable-user-env-probe --port 0
[15660 ms]
*
* Visual Studio Code Server
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license https://aka.ms/vscode-remote/license
*
[15694 ms] IP Address: 172.17.0.3
[15696 ms] Extension host agent listening on 45223
[15696 ms] Start: Run in container: echo 45223 >/root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/.devport
[15696 ms]
[15696 ms] [10:08:45] Extension host agent started.
[15697 ms]
[15697 ms]
[15697 ms] Forwarding local port 45223 to container port 45223
[15697 ms] Start: Setting up SSH authentication socket.
[15698 ms]
--------------------------
Published Ports:
8000/tcp -> 127.0.0.1:8000
--------------------------
Notifications:
Could not fetch remote environment
Failed to connect to the remote extension host server (Error: connect ECONNREFUSED ::1:37469)
VS Code window log:
[2020-01-04 10:44:22.405] [renderer1] [error] [remote-connection][ExtensionHost][563bd…][initial][localhost:37469] socketFactory.connect() failed. Error:
[2020-01-04 10:44:22.406] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.406] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2020-01-04 10:44:22.406] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.407] [renderer1] [error] [remote-connection][Management ][71630…][initial][localhost:37469] socketFactory.connect() failed. Error:
[2020-01-04 10:44:22.407] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.407] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2020-01-04 10:44:22.407] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.666] [renderer1] [error] connect ECONNREFUSED ::1:37469: Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.667] [renderer1] [error] Could not fetch environment: Error: Could not fetch environment
at file:///opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:3798:126
at processTicksAndRejections (internal/process/task_queues.js:89:5)
[2020-01-04 10:44:22.667] [renderer1] [error] connect ECONNREFUSED ::1:37469: Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:56:49.757] [renderer1] [error] Could not fetch environment: Error: Could not fetch environment
at file:///opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:3798:126
The result: VS Code Error State
Steps I have tried
install older versions of the extension to check for a regression
try vs code insider
create a new container file with a template from vs code
At this point I think I know little about how the extension works to debug this any further. It would be great if you could point me to more steps I could try.
Thank you