-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.node
More file actions
40 lines (36 loc) · 1.5 KB
/
Dockerfile.node
File metadata and controls
40 lines (36 loc) · 1.5 KB
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
34
35
36
37
38
39
40
# Multi-stage build for reaper-node installer image
# Contains containerd-shim-reaper-v2, reaper-runtime, and install script.
# Used as an init container in the Helm chart's DaemonSet to install
# Reaper binaries onto cluster nodes.
# Supports multi-arch builds via docker buildx.
# --- Builder stages (cross-compile on native platform) ---
FROM --platform=$BUILDPLATFORM messense/rust-musl-cross:x86_64-musl AS builder-amd64
WORKDIR /work
COPY . .
RUN cargo build --release \
--bin containerd-shim-reaper-v2 \
--bin reaper-runtime \
--target x86_64-unknown-linux-musl && \
mkdir -p /out && \
cp target/x86_64-unknown-linux-musl/release/containerd-shim-reaper-v2 /out/ && \
cp target/x86_64-unknown-linux-musl/release/reaper-runtime /out/
FROM --platform=$BUILDPLATFORM messense/rust-musl-cross:aarch64-musl AS builder-arm64
WORKDIR /work
COPY . .
RUN cargo build --release \
--bin containerd-shim-reaper-v2 \
--bin reaper-runtime \
--target aarch64-unknown-linux-musl && \
mkdir -p /out && \
cp target/aarch64-unknown-linux-musl/release/containerd-shim-reaper-v2 /out/ && \
cp target/aarch64-unknown-linux-musl/release/reaper-runtime /out/
# --- Arch selector (FROM supports global ARG expansion, COPY --from does not) ---
ARG TARGETARCH
FROM builder-${TARGETARCH} AS builder
# --- Runtime stage ---
FROM alpine:3.19
ARG TARGETARCH
COPY --from=builder /out/ /binaries/${TARGETARCH}/
COPY scripts/install-node.sh /install.sh
RUN chmod +x /install.sh
ENTRYPOINT ["/install.sh"]