Is it possible to run locally default GitHub Codespaces image locally? - docker

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.

Related

Error creating a container after Windows Update

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.

VS-Code multistage build fails with "No such image: scratch"

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..

vscode .devcontainer and docker-compose version mismatch

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.

VS Code Container Remote Extension: Could not fetch remote environment

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

How to bind mounted persistent volumes on docker ? I'm trying to run Sonarqube on docker

I want to run SonarQube on docker. When I run the whiteout volume persist option, it works properly with this command:
docker run -d --name sonarqube -p 9000:9000 sonarqube
But when I try to set bind-mounted persistent volumes, my docker doesn't start. The docker command used is:
docker run -d --name sonarqube \
-p 9000:9000 \
-v /opt/docker-mounts/sonaarqube/conf:/opt/sonarqube/conf \
-v /opt/docker-mounts/sonaarqube/data:/opt/sonarqube/data \
-v /opt/docker-mounts/sonaarqube/logs:/opt/sonarqube/logs \
-v /opt/docker-mounts/sonaarqube/extensions:/opt/sonarqube/extensions \
sonarqube
Note: I run docker command with root privilege.
I use this SonarQube image from Docker Hub: https://hub.docker.com/_/sonarqube?tab=description
I get this Error in docker logs :
>
06:42:37.293 [main] WARN org.sonar.application.config.AppSettingsLoaderImpl - Configuration file not found: /opt/sonarqube/conf/sonar.properties
2019.07.07 06:42:37 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2019.07.07 06:42:37 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.07.07 06:42:37 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2019.07.07 06:42:38 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.07.07 06:42:38 INFO app[][o.e.p.PluginsService] no modules loaded
2019.07.07 06:42:38 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019-07-07 06:42:41,143 main ERROR Unable to create file /opt/sonarqube/logs/es.log java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1024)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:628)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:608)
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:145)
at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)
2019-07-07 06:42:41,148 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory#5dcd8c7a] unable to create manager for [/opt/sonarqube/logs/es.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData#2250b9f2[pattern=/opt/sonarqube/logs/es.%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=%d{yyyy.MM.dd HH:mm:ss} %-5level es[][%logger{1.}] %msg%n, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory#5dcd8c7a] unable to create manager for [/opt/sonarqube/logs/es.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData#2250b9f2[pattern=/opt/sonarqube/logs/es.%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=-2147483648, max=2147483647, useMax=false), advertiseURI=null, layout=%d{yyyy.MM.dd HH:mm:ss} %-5level es[][%logger{1.}] %msg%n, filePermissions=null, fileOwner=null]]
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:115)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:114)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:145)
at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:61)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:123)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)
2019-07-07 06:42:41,152 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:235)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)
2019-07-07 06:42:41,154 main ERROR Null object returned for RollingFile in Appenders.
2019-07-07 06:42:41,154 main ERROR Unable to locate appender "file_es" for logger config "root"
2019.07.07 06:42:41 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.07.07 06:42:41 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.07.07 06:42:41 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
I think you have persistented the volumes but there is no file and required permissions. Follow below steps.
Start the container without persistent volume
$ docker run -d --name sonarqube -p 9000:9000 sonarqube
$ docker ps -f name=sonarqube
Note down the container id.
Copy folders from the container to host directory
$ cd /opt/docker-mounts/sonaarqube
$ chown -R 999:999 .
$ docker cp -a CONTAINER_ID:/opt/sonarqube/conf .
$ docker cp -a CONTAINER_ID:/opt/sonarqube/logs . # this can be skipped is not required
$ docker cp -a CONTAINER_ID:/opt/sonarqube/data . # optional, if you need the existing data from the container
$ docker cp -a CONTAINER_ID:/opt/sonarqube/extensions .
Now start the container with persistent volumes
$ docker run -d --name sonarqube \
-p 9000:9000 \
-v /opt/docker-mounts/sonaarqube/conf:/opt/sonarqube/conf \
-v /opt/docker-mounts/sonaarqube/data:/opt/sonarqube/data \
-v /opt/docker-mounts/sonaarqube/logs:/opt/sonarqube/logs \
-v /opt/docker-mounts/sonaarqube/extensions:/opt/sonarqube/extensions \
sonarqube

Resources