-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm
executable file
·37 lines (30 loc) · 1.05 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
34
35
36
37
# --- build image
FROM rust:1.80 AS builder
RUN rustup target add aarch64-unknown-linux-musl && \
apt-get update && \
apt-get install -y musl-tools musl-dev && \
update-ca-certificates
ENV USER=app
ENV UID=10001
RUN adduser \
--disabled-password \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --release && mv /app/target/release/wastebin /app
FROM scratch
COPY --from=builder /lib/aarch64-linux-gnu/libgcc_s.so.1 /lib/aarch64-linux-gnu/libgcc_s.so.1
COPY --from=builder /lib/aarch64-linux-gnu/libm.so.6 /lib/aarch64-linux-gnu/libm.so.6
COPY --from=builder /lib/aarch64-linux-gnu/libc.so.6 /lib/aarch64-linux-gnu/libc.so.6
COPY --from=builder /lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
WORKDIR /app
COPY --from=builder /app/wastebin .
USER app:app
CMD ["/app/wastebin"]