summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index 0c0bf256..0faffb8e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1,14 @@
# syntax=docker/dockerfile:1
-FROM rust:latest AS builder
+FROM rust:alpine AS builder
+RUN apk add --no-cache musl-dev
WORKDIR /app
-RUN apt-get update && apt-get install -y musl-tools musl-dev
-RUN rustup target add x86_64-unknown-linux-musl
COPY . ./
RUN cargo build --release --target x86_64-unknown-linux-musl
+RUN strip /app/target/x86_64-unknown-linux-musl/release/authzd
-FROM scratch
+FROM gcr.io/distroless/static-debian12:nonroot
EXPOSE 50051
-WORKDIR /var/www/
+WORKDIR /var/www
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/authzd /bin/authzd
-CMD ["/bin/authzd"]
+COPY --from=builder /app/policies /etc/authzd/policies
+ENTRYPOINT ["/bin/authzd"]