summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: f1f1a67342821c73e94589aebc3b0194d1b324b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# syntax=docker/dockerfile:1
# Build stage for authzd
FROM rust:alpine AS authzd-builder
RUN apk add --no-cache musl-dev
WORKDIR /app
COPY . ./
RUN cargo build --release --target x86_64-unknown-linux-musl --offline
RUN strip /app/target/x86_64-unknown-linux-musl/release/authzd

# Build stage for getting Envoy binary
FROM envoyproxy/envoy:v1.34-latest AS envoy-binary

# Build stage for Procfile supervisor
FROM golang:1.24-alpine AS minit-builder
RUN go install github.com/xlgmokha/minit@latest

# Final stage
FROM gcr.io/distroless/base-debian12:nonroot
EXPOSE 9901 10000 50051
WORKDIR /
COPY --from=authzd-builder /app/Procfile /Procfile
COPY --from=authzd-builder /app/etc/authzd /etc/authzd
COPY --from=authzd-builder /app/etc/envoy /etc/envoy
COPY --from=authzd-builder /app/target/x86_64-unknown-linux-musl/release/authzd /bin/authzd
COPY --from=envoy-binary /usr/local/bin/envoy /bin/envoy
COPY --from=minit-builder /go/bin/minit /bin/minit
ENTRYPOINT ["/bin/minit"]