Skip to content

feat(docker): add Dockerfile + .dockerignore for dev isolation - #121

Merged
bkataru merged 2 commits into
mainfrom
feat/docker-dev-isolation
Oct 6, 2026
Merged

bkataru merged 2 commits into
mainfrom
feat/docker-dev-isolation

Conversation

@bkataru

@bkataru bkataru commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What

Adds a multi-stage Dockerfile and a .dockerignore so pawan can be built and run as a container — part of the owner-directed docker-dev-isolation workstream (rev c5b4251): every code repo gets a Dockerfile + container for parallel multi-agent work isolation, until skywalkers is ready.

Design

  • builder (rust:1.95-bookworm): installs protobuf-compiler, pkg-config, libssl-dev, ca-certificates (the native deps the prost/openssl build needs), then cargo build --release --locked -p pawan-api -p pawan. --locked keeps the build honest against the committed Cargo.lock (same guarantee as CI's --locked).
  • BuildKit cache mounts on /usr/local/cargo/registry, /usr/local/cargo/git, and /build/target persist the dependency tree across builds, so a source-only change does not recompile the ~950-dependency workspace. Requires BuildKit (DOCKER_BUILDKIT=1, default in current Docker).
  • runtime (debian:bookworm-slim): ca-certificates + libssl3 only, unprivileged uid 10001. pawan-api (the service) is the default entrypoint; the pawan CLI is available via --entrypoint pawan.
  • .dockerignore excludes target/, .git/, .omp/, and .env* — verified to cut the build context from 4.2 GB to 14 MB.

Verified (on rewritten main de893a9)

  • DOCKER_BUILDKIT=1 docker build -t pawan:docker-dev . → rc=0; image = 200 MB.
  • docker run --rm --entrypoint pawan pawan:docker-dev --version → pawan 0.5.23 (rc=0).
  • docker run --rm pawan:docker-dev (default pawan-api) → boots, pawan-api listening on port 3300 in-container.
  • Runs unprivileged: id → uid=10001(pawan).
  • Context probe: COPY . / into scratch yields 14 MB with target/ absent → .dockerignore works.

Notes

…r-dev-isolation)

Adds a multi-stage Dockerfile that builds both workspace binaries and a
.dockerignore that keeps target/ (4.2G) and .git/ out of the build context.

- builder: rust:1.95-bookworm + protobuf-compiler/pkg-config/libssl-dev
  (native deps the prost/openssl build needs); cargo build --release --locked
  with BuildKit cache mounts on the cargo registry + target dir so source-only
  changes don't recompile the ~950-dep tree.
- runtime: debian:bookworm-slim, ca-certificates + libssl3, unprivileged
  uid 10001; pawan-api is the default entrypoint, pawan CLI via --entrypoint.

Verified on the rewritten main (de893a9):
- docker build -> rc=0; image pawan:docker-dev = 200MB.
- docker run --entrypoint pawan ... --version -> 'pawan 0.5.23' (rc=0).
- docker run (default entrypoint pawan-api) -> binds port 3300 in-container.
- container runs as uid=10001(pawan), not root.
- context probe: 14MB context vs 4.2G target/ => .dockerignore excludes it.

Owner directive docker-dev-isolation (rev c5b4251).
The adopted draft pinned rust:1.95-bookworm. rust-1-99-only is the fleet
standard and pawan's CI runs 1.99; shipping an image built on 1.95 would
diverge from the toolchain CI verifies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant