A library for ATProtocol identities.
1# Multi-stage build for atproto-identity-rs workspace 2# Builds and installs all 13 binaries from the workspace 3 4# Build stage - use 1.89 to support resolver = "3" and edition = "2024" 5FROM rust:1.89-slim AS builder 6 7# Install system dependencies needed for building 8RUN apt-get update && apt-get install -y \ 9 pkg-config \ 10 libssl-dev \ 11 && rm -rf /var/lib/apt/lists/* 12 13# Set working directory 14WORKDIR /usr/src/app 15 16# Copy the entire workspace 17COPY . . 18 19# Build all binaries in release mode 20# This will build all binaries defined in the workspace: 21# - atproto-identity: 4 binaries (resolve, key, sign, validate) 22# - atproto-record: 2 binaries (sign, verify) 23# - atproto-client: 3 binaries (auth, app-password, dpop) 24# - atproto-oauth: 1 binary (service-token) 25# - atproto-oauth-axum: 1 binary (oauth-tool) 26# - atproto-jetstream: 1 binary (jetstream-consumer) 27# - atproto-xrpcs-helloworld: 1 binary (xrpcs-helloworld) 28# Note: atproto-identity-resolve requires hickory-dns feature 29RUN cargo build --release --bins -F clap,hickory-dns,zeroize,tokio 30 31# Runtime stage - use distroless for minimal attack surface 32FROM gcr.io/distroless/cc-debian12 33 34# Create directory for binaries 35WORKDIR /usr/local/bin 36 37# Copy all built binaries from builder stage 38COPY --from=builder /usr/src/app/target/release/atproto-identity-resolve . 39COPY --from=builder /usr/src/app/target/release/atproto-identity-key . 40COPY --from=builder /usr/src/app/target/release/atproto-identity-sign . 41COPY --from=builder /usr/src/app/target/release/atproto-identity-validate . 42COPY --from=builder /usr/src/app/target/release/atproto-record-sign . 43COPY --from=builder /usr/src/app/target/release/atproto-record-verify . 44COPY --from=builder /usr/src/app/target/release/atproto-client-auth . 45COPY --from=builder /usr/src/app/target/release/atproto-client-app-password . 46COPY --from=builder /usr/src/app/target/release/atproto-client-dpop . 47COPY --from=builder /usr/src/app/target/release/atproto-oauth-service-token . 48COPY --from=builder /usr/src/app/target/release/atproto-oauth-tool . 49COPY --from=builder /usr/src/app/target/release/atproto-xrpcs-helloworld . 50COPY --from=builder /usr/src/app/target/release/atproto-jetstream-consumer . 51 52# Default to the main resolution tool 53# Users can override with specific binary: docker run <image> atproto-identity-resolve --help 54# Or run other tools: 55# docker run <image> atproto-identity-key --help 56# docker run <image> atproto-record-sign --help 57# docker run <image> atproto-client-auth --help 58# docker run <image> atproto-oauth-service-token --help 59# docker run <image> atproto-oauth-tool --help 60# docker run <image> atproto-xrpcs-helloworld --help 61# docker run <image> atproto-jetstream-consumer --help 62CMD ["atproto-identity-resolve", "--help"] 63 64# Add labels for documentation 65LABEL org.opencontainers.image.title="atproto-identity-rs" 66LABEL org.opencontainers.image.description="AT Protocol identity management tools" 67LABEL org.opencontainers.image.authors="Nick Gerakines <nick.gerakines@gmail.com>" 68LABEL org.opencontainers.image.source="https://tangled.sh/@smokesignal.events/atproto-identity-rs" 69LABEL org.opencontainers.image.version="0.11.0" 70LABEL org.opencontainers.image.licenses="MIT" 71 72# Document available binaries 73LABEL binaries="atproto-identity-resolve,atproto-identity-key,atproto-identity-sign,atproto-identity-validate,atproto-record-sign,atproto-record-verify,atproto-client-auth,atproto-client-app-password,atproto-client-dpop,atproto-oauth-service-token,atproto-oauth-tool,atproto-jetstream-consumer,atproto-xrpcs-helloworld"