I am developing solutions in VSCode remote-containers (on the same machine). One project requires an image that is not available in VSCode container selection dialogue. The image in question is databricksruntime/standard
which can be found here.
I needed the Dockerfile
to go with the devcontainer.json
definition so that the container would match that specification. I found the Dockerfile
content by navigating to the associated Git.
FROM databricksruntime/dbfsfuse:experimental
RUN apt-get update \
&& apt-get install -y openssh-server \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Warning: the created user has root permissions inside the container
# Warning: you still need to start the ssh process with `sudo service ssh start`
RUN useradd --create-home --shell /bin/bash --groups sudo ubuntu
I manually created the devcontainer.json
to target the Dockerfile
image when building the container.
{
"name": "databricksruntime/standard",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
}
},
"remoteUser": "vscode",
"features": {
"git": "latest",
"git-lfs": "latest"
}
}
I selected 'Open a remote window' (bottom left of VSCode GUI) -> 'Re-open in a container'.
This raises:
[2022-08-05T17:01:32.739Z] Error response from daemon: manifest for databricksruntime/dbfsfuse:experimental not found: manifest unknown: manifest unknown
[2022-08-05T17:01:32.832Z] Stop (2843 ms): Run: docker pull databricksruntime/dbfsfuse:experimental
[2022-08-05T17:01:32.833Z] []
[2022-08-05T17:01:32.833Z] Error: No such image: databricksruntime/dbfsfuse:experimental
When we inspect the Dockerfile
we can see that it references another image. I looked at the pull command, docker pull databricksruntime/dbfsfuse
and ran it in a terminal. The image already exists and is visible in the Docker GUI. I noticed that the pull command does not include the suffix :experimental
as the first line in Dockerfile
does. I removed the suffix. The Dockerfile
now builds.
[+] Building 67.0s (17/17) FINISHED
=> [internal] load build definition from Dockerfile-with-features 0.1s
=> => transferring dockerfile: 844B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.4 2.0s
=> [auth] docker/dockerfile:pull token for registry-1.docker.io 0.0s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:443aab4c 0.0s
=> [internal] load .dockerignore 0.0s
=> [internal] load build definition from Dockerfile-with-features 0.0s
=> [internal] load metadata for docker.io/databricksruntime/dbfsfuse:lat 0.0s
=> [context dev_containers_feature_content_source] load .dockerignore 0.0s
=> => transferring dev_containers_feature_content_source: 2B 0.0s
=> [dev_container_auto_added_stage_label 1/3] FROM docker.io/databricksr 0.2s
=> [context dev_containers_feature_content_source] load from client 0.1s
=> => transferring dev_containers_feature_content_source: 270.81kB 0.0s
=> [dev_container_auto_added_stage_label 2/3] RUN apt-get update && a 22.2s
=> [dev_container_auto_added_stage_label 3/3] RUN useradd --create-home 0.6s
=> [stage-1 1/2] COPY --from=dev_containers_feature_content_source . /tm 0.1s
=> [stage-1 2/2] RUN cd /tmp/build-features/local-cache && chmod +x ./i 41.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:aa97f07c0ec4c2e8ae9d512da1bc45b63b32396266134 0.0s
=> => naming to docker.io/library/vsc-parallelloadsscd4-d62f8c81c6e595b4 0.0s
=> exporting cache 0.0s
=> => preparing build cache for export 0.0s
The container is started and then tested. Another error is raised:
[70182 ms] Shell server terminated (code: 126, signal: null)
[70182 ms] unable to find user vscode: no matching entries in passwd file
[2022-08-05T17:10:05.189Z] Start: Run in container: cat /etc/passwd
[2022-08-05T17:10:05.189Z] Stdin closed! [2022-08-05T17:10:05.190Z]
Error: An error occurred setting up the container. [2022-08-05T17:10:05.190Z] at HR (c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:239:2183) [2022-08-05T17:10:05.190Z] at tb (c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:239:2121)
[2022-08-05T17:10:05.190Z] at processTicksAndRejections (node:internal/process/task_queues:96:5) [2022-08-05T17:10:05.190Z]
at async QR (c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:2006)
[2022-08-05T17:10:05.190Z] at async cb (c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:3110)
[2022-08-05T17:10:05.190Z] at async i_ (c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:13194)
[2022-08-05T17:10:05.190Z] at async n_ (c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:12950)
[2022-08-05T17:10:05.200Z] Stop (69586 ms): Run: C:\Users\mruser\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\mruser\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\mruser\source\repos\data\ParallelLoadsScd4 --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\mruser\source\repos\data\ParallelLoadsScd4 --log-level debug --log-format json --config c:\Users\mruser\source\repos\data\ParallelLoadsScd4.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-08-05T17:10:05.200Z] Exit code 1
[2022-08-05T17:10:05.204Z] Command failed: C:\Users\mruser\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\mruser.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\mruser\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\mruser\source\repos\data\ParallelLoadsScd4 --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\mruser\source\repos\data\ParallelLoadsScd4 --log-level debug --log-format json --config c:\Users\mruser\source\repos\data\ParallelLoadsScd4.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-08-05T17:10:05.204Z] Exit code 1
A user is missing for VSCode. This user is presumably so that VSCode local can interface with VSCode remote. This user is defined as "remoteUser": "vscode",
in devcontainer.json
.
I have seen this SO answer. I am not sure how to define this user, more reading needed.
I modified the devcontainer.json
to set the vscode user to "remoteUser": "root",
. This seems wrong. The container runs now. I referenced this article.
I am still looking into this. Has anyone faced this issue? What am I missing?