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