Skip to content

Commit d2f125f

Browse files
committed
Revert "fix: standardize to vscode user across all configurations"
This reverts commit 9d53582.
1 parent 9d53582 commit d2f125f

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

.coder/template.tf

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ resource "docker_container" "workspace" {
290290
"MAVEN_OPTS=-Xmx2g -XX:+UseG1GC -XX:+UseStringDeduplication",
291291
"JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0",
292292
"NODE_OPTIONS=--max-old-space-size=2048",
293-
"HISTFILE=/home/vscode/.bash_history_dir/bash_history",
294-
"GIT_CONFIG_GLOBAL=/home/vscode/.gitconfig_dir/gitconfig"
293+
"HISTFILE=/root/.bash_history_dir/bash_history",
294+
"GIT_CONFIG_GLOBAL=/root/.gitconfig_dir/gitconfig"
295295
]
296296

297297
# Workspace directory (persistent Git repository)
@@ -303,58 +303,64 @@ resource "docker_container" "workspace" {
303303
# Cache volumes (rebuilds are OK)
304304
volumes {
305305
volume_name = docker_volume.vscode_extensions.name
306-
container_path = "/home/vscode/.vscode-server/extensions"
306+
container_path = "/root/.vscode-server/extensions"
307307
}
308308

309309
volumes {
310310
volume_name = docker_volume.maven_cache.name
311-
container_path = "/home/vscode/.m2"
311+
container_path = "/root/.m2"
312312
}
313313

314314
volumes {
315315
volume_name = docker_volume.npm_cache.name
316-
container_path = "/home/vscode/.npm"
316+
container_path = "/root/.npm"
317317
}
318318

319319
# User credentials (persistent across host)
320320
volumes {
321321
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/claude/.claude"
322-
container_path = "/home/vscode/.claude"
322+
container_path = "/root/.claude"
323+
}
324+
325+
# Claude configuration file (must be pre-created as a file on host)
326+
volumes {
327+
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/claude/.claude.json"
328+
container_path = "/root/.claude.json"
323329
}
324330

325331
volumes {
326332
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/gemini/.gemini"
327-
container_path = "/home/vscode/.gemini"
333+
container_path = "/root/.gemini"
328334
}
329335

330336
volumes {
331337
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/.config/gh"
332-
container_path = "/home/vscode/.config/gh"
338+
container_path = "/root/.config/gh"
333339
}
334340

335341
volumes {
336342
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/bash-history/.bash_history"
337-
container_path = "/home/vscode/.bash_history_dir"
343+
container_path = "/root/.bash_history_dir"
338344
}
339345

340346
volumes {
341347
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/gitconfig/.gitconfig"
342-
container_path = "/home/vscode/.gitconfig_dir"
348+
container_path = "/root/.gitconfig_dir"
343349
}
344350

345351
volumes {
346352
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/ssh/.ssh"
347-
container_path = "/home/vscode/.ssh"
353+
container_path = "/root/.ssh"
348354
}
349355

350356
volumes {
351357
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/docker/.docker"
352-
container_path = "/home/vscode/.docker"
358+
container_path = "/root/.docker"
353359
}
354360

355361
volumes {
356362
host_path = "/home/coder/.coder-mount/${data.coder_workspace_owner.me.name}/kube/.kube"
357-
container_path = "/home/vscode/.kube"
363+
container_path = "/root/.kube"
358364
}
359365

360366
# Docker socket for Docker-in-Docker

.devcontainer/Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,9 @@ USER vscode
156156
RUN mkdir -p ~/.m2/repository ~/.m2/wrapper/dists ~/.npm ~/.cache/ms-playwright \
157157
&& chmod -R 755 ~/.m2 ~/.npm ~/.cache
158158

159-
# Reset working directory and user
159+
# Reset working directory
160160
USER root
161161
WORKDIR /workspaces
162162

163-
# Set default user to vscode (non-root)
164-
# This ensures container starts as vscode user even without devcontainer.json
165-
USER vscode
166-
167163
# Default command
168164
CMD ["sleep", "infinity"]

0 commit comments

Comments
 (0)