A library for ATProtocol identities.
1# Multi-stage build for atproto-identity-rs workspace
2# Builds and installs all 9 binaries from the workspace
3
4# Build stage - use 1.87 to support resolver = "3" and edition = "2024"
5FROM rust:1.87-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, sign, validate, key)
22# - atproto-record: 2 binaries (sign, verify)
23# - atproto-oauth-axum: 1 binary (oauth-tool)
24# - atproto-client: 1 binary (client-dpop)
25# - atproto-xrpcs-helloworld: 1 binary (xrpcs-helloworld)
26RUN cargo build --release --bins
27
28# Runtime stage - use distroless for minimal attack surface
29FROM gcr.io/distroless/cc-debian12
30
31# Create directory for binaries
32WORKDIR /usr/local/bin
33
34# Copy all built binaries from builder stage
35COPY --from=builder /usr/src/app/target/release/atproto-identity-resolve .
36COPY --from=builder /usr/src/app/target/release/atproto-identity-sign .
37COPY --from=builder /usr/src/app/target/release/atproto-identity-validate .
38COPY --from=builder /usr/src/app/target/release/atproto-identity-key .
39COPY --from=builder /usr/src/app/target/release/atproto-record-sign .
40COPY --from=builder /usr/src/app/target/release/atproto-record-verify .
41COPY --from=builder /usr/src/app/target/release/atproto-oauth-tool .
42COPY --from=builder /usr/src/app/target/release/atproto-client-dpop .
43COPY --from=builder /usr/src/app/target/release/atproto-xrpcs-helloworld .
44
45# Default to the main resolution tool
46# Users can override with specific binary: docker run <image> atproto-identity-resolve --help
47# Or run other tools:
48# docker run <image> atproto-record-sign --help
49# docker run <image> atproto-oauth-tool --help
50# docker run <image> atproto-client-dpop --help
51# docker run <image> atproto-xrpcs-helloworld --help
52CMD ["atproto-identity-resolve", "--help"]
53
54# Add labels for documentation
55LABEL org.opencontainers.image.title="atproto-identity-rs"
56LABEL org.opencontainers.image.description="AT Protocol identity management tools"
57LABEL org.opencontainers.image.authors="Nick Gerakines <nick.gerakines@gmail.com>"
58LABEL org.opencontainers.image.source="https://tangled.sh/@smokesignal.events/atproto-identity-rs"
59LABEL org.opencontainers.image.version="0.5.0"
60LABEL org.opencontainers.image.licenses="MIT"
61
62# Document available binaries
63LABEL binaries="atproto-identity-resolve,atproto-identity-sign,atproto-identity-validate,atproto-identity-key,atproto-record-sign,atproto-record-verify,atproto-oauth-tool,atproto-client-dpop,atproto-xrpcs-helloworld"