-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.arm
33 lines (26 loc) · 1.07 KB
/
Dockerfile.arm
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
31
32
33
# build shoutrrr library
FROM docker.io/library/golang:1.23.5-bookworm AS lib
WORKDIR /usr/src/app
COPY go/go.mod go/go.sum ./
RUN go mod download && go mod verify
COPY go/*.go .
RUN CGO_ENABLED=1 go build -v -ldflags '-s -w -linkmode external -extldflags "static"' -trimpath -buildmode=c-archive -o libshoutrrr.a shoutrrr.go
# chef
FROM docker.io/library/rust:1.84.1 AS chef
RUN cargo install cargo-chef
WORKDIR /usr/src
# planner
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
# Builder
FROM chef AS builder
COPY --from=planner /usr/src/recipe.json recipe.json
RUN cargo chef cook --release --target aarch64-unknown-linux-gnu --recipe-path recipe.json
COPY . .
COPY --from=lib /usr/src/app/libshoutrrr.a /usr/src/app/libshoutrrr.h ./go/
RUN cargo build --release --target aarch64-unknown-linux-gnu --bin uptimers
# Clean image
FROM gcr.io/distroless/cc-debian12@sha256:9ce403f022aeca3fd0954e71ae43684f8be7159390d28967f3fb5b6488362196
COPY --from=builder /usr/src/target/aarch64-unknown-linux-gnu/release/uptimers /usr/bin/uptimers
ENTRYPOINT ["uptimers"]