-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathDockerfile.armv6.binary
More file actions
33 lines (22 loc) · 1.04 KB
/
Dockerfile.armv6.binary
File metadata and controls
33 lines (22 loc) · 1.04 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
# syntax=docker/dockerfile:1.7-labs
FROM rust:bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
libc6-dev-armhf-cross \
&& rm -rf /var/lib/apt/lists/*
RUN rustup target add arm-unknown-linux-gnueabihf
WORKDIR /usr/src/app
COPY Cargo.toml Cargo.lock build.rs ./
COPY src/protos ./src/protos
RUN mkdir -p src && printf 'fn main() {}\n' > src/main.rs
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
cargo build --release --target arm-unknown-linux-gnueabihf || true
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
cargo build --release --target arm-unknown-linux-gnueabihf
FROM scratch AS export
COPY --from=builder /usr/src/app/target/arm-unknown-linux-gnueabihf/release/aa-proxy-rs /aa-proxy-rs
# DOCKER_BUILDKIT=1 docker build -f Dockerfile.armv6.binary --target export --output type=local,dest=./output .