Something went wrong. Try again.
Rust implementation of OCI Distribution Spec with granular access control
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940# Build stage - using bookworm (Debian 12) which is more current# Note: The builder image may show vulnerabilities, but these are not present in the final runtime image# since we use a multi-stage build with distroless runtime (only 79.6MB, minimal attack surface)FROM rust:1.91.1-trixie AS builder
WORKDIR /app
# Install build dependenciesRUN apt-get update && apt-get install -y \ pkg-config \ libssl-dev \ && rm -rf /var/lib/apt/lists/*
# Copy manifestsCOPY Cargo.toml ./
# Copy source codeCOPY src ./src
# Build release binary (both grain and grainctl)RUN cargo build --release
# Runtime stage - use Google's distroless image for minimal attack surfaceFROM gcr.io/distroless/cc-debian12:nonroot
WORKDIR /app
# Copy binaries from builderCOPY --from=builder /app/target/release/grain /app/grainCOPY --from=builder /app/target/release/grainctl /app/grainctl
# Expose registry portEXPOSE 8888
# Set default environment variablesENV RUST_LOG=info
# Default command (distroless already runs as nonroot user)CMD ["/app/grain", "--host", "0.0.0.0:8888", "--users-file", "/data/users.json"]