Skip to content

Commit 40ea65b

Browse files
committed
Update devcontainer.json and Dockerfile to use environment variables for user configuration
1 parent 240a10d commit 40ea65b

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian:trixie-slim
22

3-
ARG USERNAME=developer
3+
ARG USERNAME
44
ARG USER_UID=1000
55
ARG USER_GID=${USER_UID}
66

.devcontainer/devcontainer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "devcontainer-templates",
33
"build": {
4-
"dockerfile": "Dockerfile"
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"USERNAME": "${localEnv:DEVCONTAINER_USERNAME:dev}",
7+
"USER_UID": "${localEnv:DEVCONTAINER_USER_UID:1000}",
8+
"USER_GID": "${localEnv:DEVCONTAINER_USER_GID:1000}"
9+
}
510
},
6-
"remoteUser": "developer",
7-
"containerUser": "developer",
11+
"remoteUser": "${localEnv:DEVCONTAINER_USERNAME:dev}",
12+
"containerUser": "${localEnv:DEVCONTAINER_USERNAME:dev}",
813
"features": {
914
"ghcr.io/sourecode/devcontainer-features/claude-code:1": {},
1015
"ghcr.io/sourecode/devcontainer-features/rtk:1": {},

0 commit comments

Comments
 (0)