Skip to content

Commit 29fa817

Browse files
committed
fix: Set user-owned Cargo and Rustup homes in Dockerfile
Moves the CARGO_HOME and RUSTUP_HOME environment variable definitions into the Dockerfile. This ensures that cargo and rustup are configured to use user-owned directories, resolving permission errors when installing packages or toolchains. The directories are created and permissions are set for the vscode user during the image build process.
1 parent 88f846b commit 29fa817

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.devcontainer/ai-container/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@ RUN wget -q -O go.tar.gz https://go.dev/dl/go1.25.0.linux-amd64.tar.gz \
88
ENV PATH="/usr/local/go/bin:${PATH}"
99

1010
# Install Rust (rustup with latest stable, system-wide)
11-
ENV RUSTUP_HOME=/usr/local/rustup \
12-
CARGO_HOME=/usr/local/cargo \
13-
PATH=/usr/local/cargo/bin:${PATH}
1411
RUN apt-get update \
1512
&& apt-get install -y --no-install-recommends ca-certificates curl \
1613
&& rm -rf /var/lib/apt/lists/* \
1714
&& curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain stable \
1815
&& rustc --version && cargo --version
1916

17+
# --- Cargo ---
18+
ENV CARGO_HOME=/home/vscode/.cargo
19+
ENV RUSTUP_HOME=/home/vscode/.rustup
20+
ENV PATH=${CARGO_HOME}/bin:${PATH}
21+
22+
RUN mkdir -p ${CARGO_HOME} /home/vscode/.rustup \
23+
&& chown -R vscode:vscode ${CARGO_HOME} /home/vscode/.rustup
24+
2025
# Install Node.js LTS (required for CLIs)
2126
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - \
2227
&& apt-get install -y nodejs
@@ -41,6 +46,7 @@ RUN set -eux; \
4146
# Install Claude Code, Gemini CLI, Codex CLI, and Crush globally via npm
4247
RUN npm install -g @anthropic-ai/claude-code @google/gemini-cli @openai/codex @charmland/crush
4348

49+
# Install prerequisites and Wassette (without using the CLI installer)
4450
# Install prerequisites and Wassette (without using the CLI installer)
4551
ARG DEBIAN_FRONTEND=noninteractive
4652
ARG WASSETTE_VERSION=v0.2.0

0 commit comments

Comments
 (0)