--- display_name: Rust Development Workspace description: Docker workspace for Rust development with rustup, Python, and Claude Code. icon: /icon/rust.svg maintainer_github: sirblob verified: false tags: [docker, container, gpu, rust, python, claude, ollama] --- # Rust Development Workspace Docker workspace for Rust development with rustup, Python, and Claude Code. Provisions a Docker container as a [Coder workspace](https://coder.com/docs/workspaces) with selectable GPU passthrough, Docker-out-of-Docker, and a persistent home directory. ## Preinstalled tools - Rust stable via rustup, with cargo, clippy, rustfmt, and rust-src - Python 3 with pip, venv, and uv - Claude Code - Docker CLI for Docker-out-of-Docker - Gitea CLI (`tea`) - code-server and JetBrains Toolbox support ## Parameters | Parameter | Description | Default | | --- | --- | --- | | `GPU Assignment` | Which GPU(s) to attach: GPU 0, GPU 1, or both. GPU 1 is shared with the Ollama and Immich stacks. | GPU 0 | ## Prerequisites The host needs the NVIDIA container toolkit for GPU passthrough. Coder itself runs as a container and creates workspaces through the host's Docker socket, so its service needs the socket mounted and the host `docker` group added: ```yaml volumes: - /var/run/docker.sock:/var/run/docker.sock group_add: - "987" ``` Workspaces get the same GID through the `docker_group_id` template variable, which defaults to `987`. Confirm the host GID with `getent group docker` and override the variable if it differs. ## Ollama `OLLAMA_HOST` is preset to `http://host.docker.internal:11434`. Verify with: ```sh curl "$OLLAMA_HOST/api/tags" ``` ## Gitea The `tea` CLI manages repositories, issues, and pull requests from the workspace: ```sh tea login add --name sirblob --url https://git.sirblob.co --token tea repos list ``` Docker-out-of-Docker lets you build and push images to the registry: ```sh docker login git.sirblob.co -u -p docker build -t git.sirblob.co//: . docker push git.sirblob.co//: ``` ## Updates The image is built with the base packages already upgraded, and the agent runs `apt-get update` and `apt-get upgrade` on every workspace start so a long-lived container keeps picking up security updates. ## Persistence `/home/coder` is mapped to a host directory and survives workspace restarts. The rest of the root filesystem is ephemeral, so every preinstalled tool lives under `/opt` or `/usr/local` instead of the home directory. ## Files | File | Contents | | --- | --- | | `main.tf` | Providers, data sources, and shared locals | | `parameters.tf` | Workspace parameters | | `agent.tf` | Coder agent, startup script, and metadata | | `apps.tf` | code-server and JetBrains modules | | `container.tf` | Docker image build and container resource | | `Dockerfile` | Workspace image |