Files
DeepSeek-TUI/.devcontainer/Dockerfile
pingg02 8b1ceea7f0 fix(devcontainer): support Windows development
Use a dedicated development image so Cargo builds have the Rust toolchain, rustfmt, pkg-config, and DBus headers instead of inheriting the minimal release runtime.\n\nReplace the host HOME bind mount with named volumes for CodeWhale state and Cargo artifacts. This avoids invalid Windows HOME expansion, preserves non-root write access, and keeps Rust build churn off the workspace bind mount.\n\nDocument the Dev Container storage and rebuild behavior.\n\nVerification:\n- Built the Dev Container image with Docker Desktop\n- Verified non-root Cargo, Rust, Git, pkg-config, DBus discovery, and writable state/target paths\n- cargo build --locked\n- cargo test -p codewhale-config --locked
2026-07-30 19:26:47 +08:00

30 lines
1.2 KiB
Docker

ARG RUST_VERSION=1.88
FROM rust:${RUST_VERSION}-slim-bookworm
# Native DBus headers and pkg-config are required by libdbus-sys during
# `cargo build`. Keep these development dependencies in the Dev Container,
# rather than adding them to the production runtime image.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
libdbus-1-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# The official Rust image keeps its toolchain here. Preserve it after switching
# from the image's root user to the non-root development user below.
ENV PATH=/usr/local/cargo/bin:${PATH}
RUN printf '%s\n' 'export PATH=/usr/local/cargo/bin:$PATH' \
> /etc/profile.d/codewhale-rust.sh
RUN rustup component add rustfmt
RUN groupadd --gid 1000 codewhale \
&& useradd --create-home --shell /bin/bash --uid 1000 --gid 1000 codewhale \
&& install -d -m 0700 -o codewhale -g codewhale /home/codewhale/.codewhale \
&& install -d -m 0755 -o codewhale -g codewhale /home/codewhale/.cargo \
&& install -d -m 0755 -o codewhale -g codewhale /home/codewhale/.cargo/target
USER codewhale
WORKDIR /workspaces/CodeWhale