-
Notifications
You must be signed in to change notification settings - Fork 71
/
Dockerfile
39 lines (20 loc) · 1.01 KB
/
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
31
32
33
34
35
36
37
38
39
FROM --platform=linux/amd64 rust:1-bookworm as builder-arm64
RUN apt update && apt upgrade -y
RUN apt install -y g++-arm-linux-gnueabihf libc6-dev-armhf-cross
ENV RUST_TARGET=armv7-unknown-linux-gnueabihf
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN rustup toolchain install stable-armv7-unknown-linux-gnueabihf
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
CXX_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
FROM --platform=linux/amd64 rust:1-bookworm as builder-amd64
ENV RUST_TARGET=x86_64-unknown-linux-gnu
FROM --platform=linux/amd64 builder-${TARGETARCH} as builder
WORKDIR /code
COPY . .
RUN cargo build --release --target ${RUST_TARGET} --all-features
RUN cp /code/target/${RUST_TARGET}/release/oura /oura
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /oura /usr/local/bin/oura
ENTRYPOINT [ "oura" ]