Skip to content

🛠️ Reproducible Rust dev container built on rust:1.83-slim + curated tools (fmt, clippy, PostgreSQL, Redis, Protobuf, WASM). Designed for CI parity and local development across all JohnBasrai GitHub Rust projects.

License

Notifications You must be signed in to change notification settings

JohnBasrai/rust-base-containers

Repository files navigation

rust-base-containers

Build and Push

🛠️ Reusable Rust development and runtime containers with support for formatting, linting, Diesel, PostgreSQL, Redis, Protobuf, and WASM. Designed to ensure CI parity and streamlined local development across all JohnBasrai GitHub Rust projects.

⚠️ Using the rust-dev container with dependencies preinstalled can reduce build times by up to 5 minutes or more vs using offical rust:1.83-slim base image.


📌 Versioning Policy

Container tags follow a two-track policy:

  • rust-dev uses X.Y.0-revN format, where X.Y matches the Rust toolchain version (e.g., 1.83.0-rev5)
  • rust-runtime uses A.B.C format aligned with downstream consumer crate versions (e.g., 0.1.3 from cr8s-fe)

❗ Tags do not use a v prefix.
For full details, see CONTRIBUTING.md.


Features

  • 🦀 Rust toolchain (with clippy, rustfmt)
  • 🧪 cargo test, cargo audit, cargo outdated, and cargo fmt integration
  • 🗄️ PostgreSQL cli + client libraries
  • 🔌 Redis support
  • 🧬 protoc and prost-build for gRPC / Protobuf workflows
  • 🌐 WASM support via wasm32-unknown-unknown target
  • ⚙️ Optimized for use in GitHub Actions, Docker Compose, and local dev

Container Variants

This project builds and publishes two containers under ghcr.io/johnbasrai/cr8s/:

rust-dev

  • Full-featured dev container for building, testing, and formatting
  • Based on rust:1.83-slim
  • Includes Redis tools, cargo-audit, protobuf, and rustfmt
  • Tagged as:
    • ghcr.io/johnbasrai/cr8s/rust-dev:1.83.0-rev5

rust-runtime

  • Minimal runtime container
  • Based on a pinned digest of debian:bookworm-slim
  • Installs only ca-certificates
  • Used to run statically linked Rust apps
  • Tagged as:
    • ghcr.io/johnbasrai/cr8s/rust-runtime:0.1.3

⚠️ Security Note:

The rust-runtime container includes common debugging tools for development and demonstration purposes. Do not deploy this image to production without stripping these tools and applying hardening best practices.


🔁 Example: Using rust-runtime in cr8s

# Dockerfile in cr8s/
FROM ghcr.io/johnbasrai/cr8s/rust-runtime:0.1.3

# Copy your compiled binary
COPY target/release/cr8s /usr/local/bin/cr8s

CMD ["cr8s"]

About

🛠️ Reproducible Rust dev container built on rust:1.83-slim + curated tools (fmt, clippy, PostgreSQL, Redis, Protobuf, WASM). Designed for CI parity and local development across all JohnBasrai GitHub Rust projects.

Resources

License

Stars

Watchers

Forks

Packages