-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (21 loc) · 880 Bytes
/
Dockerfile
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
28
29
30
FROM --platform=$BUILDPLATFORM rust:1.82.0 AS builder
RUN apt-get update && apt-get install -y \
gcc-aarch64-linux-gnu \
gcc-x86-64-linux-gnu
RUN rustup target add \
aarch64-unknown-linux-gnu \
x86_64-unknown-linux-gnu
COPY . /app
WORKDIR /app
ARG TARGETPLATFORM
RUN case $TARGETPLATFORM in \
linux/amd64) TARGET=x86_64-unknown-linux-gnu ;; \
linux/arm64) TARGET=aarch64-unknown-linux-gnu ;; \
esac && \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc \
cargo build --release --target $TARGET && \
cp target/$TARGET/release/ddns-cloudflare .
FROM gcr.io/distroless/cc-debian12:latest@sha256:6f05aba4de16e89f8d879bf2a1364de3e41aba04f1dcbba8c75494f6134b4b13
COPY --from=builder /app/ddns-cloudflare /
ENTRYPOINT ["/ddns-cloudflare"]