Skip to content

Commit 95fa6fd

Browse files
IDE: adjust the Docker env used by devcontainer
The base Docker image generated and made available by Microsoft [a] already has an ubuntu user (UID=1000) and a vscode user (UID=1001) registered. No problem occurs if we directly run a container based on this image, even selecting vscode as user, but for some reason, when someone uses the VS Code feature [b], 'vscode-server' creates a container based on the image [a] but it defines the user who runs the container on the host as UID=1001 (a non-existent user on my host). This results in access denied issues on any file edited using VS Code. Therefore, we need to at least create a workaround, forcing the vscode user to be UID=1000. [a] mcr.microsoft.com/vscode/devcontainers/base:noble [b] The Dev Containers extension lets you use a Docker container as a full-featured development environment. Signed-off-by: Claudio André <[email protected]>
1 parent 15f025e commit 95fa6fd

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

.github/actions/spelling/expect.txt

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ cyggomp
5757
cygz
5858
davidanson
5959
debhelper
60+
deluser
6061
devcontainer
6162
distro
6263
dmg

IDE/.devcontainer/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
2424

2525
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2626
RUN curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | bash -s -- -y
27+
RUN deluser --remove-home ubuntu
2728

2829
USER vscode
2930
HEALTHCHECK NONE

IDE/.devcontainer/devcontainer.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "Ubuntu",
3-
"remoteUser": "vscode",
43
"mounts": [
54
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
65
],

0 commit comments

Comments
 (0)