support arm64 build
parent
4e91d2e512
commit
69a5e61ceb
@ -1,19 +1,22 @@
|
|||||||
# syntax = docker/dockerfile:1.2.1
|
# syntax = docker/dockerfile:1.2.1
|
||||||
|
FROM rust:latest as builder
|
||||||
FROM clux/muslrust:stable as builder
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
WORKDIR /rust-src
|
WORKDIR /rust-src
|
||||||
COPY . /rust-src
|
COPY . /rust-src
|
||||||
|
|
||||||
|
RUN apt update && apt upgrade -y && apt install -y gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu
|
||||||
|
|
||||||
|
RUN rustup target add "$(uname -m)-unknown-linux-musl"
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/rust-src/target \
|
RUN --mount=type=cache,target=/rust-src/target \
|
||||||
--mount=type=cache,target=/root/.cargo/git \
|
--mount=type=cache,target=/root/.cargo/git \
|
||||||
--mount=type=cache,target=/root/.cargo/registry \
|
--mount=type=cache,target=/root/.cargo/registry \
|
||||||
["cargo", "build", "--release", "--target", "x86_64-unknown-linux-musl", "-p", "dockerfile-plus"]
|
cargo build --release --target "$(uname -m)-unknown-linux-musl" -p dockerfile-plus --verbose
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/rust-src/target \
|
RUN --mount=type=cache,target=/rust-src/target \
|
||||||
["cp", "/rust-src/target/x86_64-unknown-linux-musl/release/dockerfile-plus", "/usr/local/bin/dockerfile-plus"]
|
cp "/rust-src/target/$(uname -m)-unknown-linux-musl/release/dockerfile-plus" /usr/local/bin/dockerfile-plus
|
||||||
|
|
||||||
FROM docker/dockerfile:1.2.1
|
FROM docker/dockerfile:1.2.1
|
||||||
COPY --from=builder /usr/local/bin/dockerfile-plus /usr/local/bin/dockerfile-plus
|
COPY --from=builder /usr/local/bin/dockerfile-plus /usr/local/bin/dockerfile-plus
|
||||||
ENTRYPOINT ["/usr/local/bin/dockerfile-plus"]
|
ENTRYPOINT ["/usr/local/bin/dockerfile-plus"]
|
||||||
|
Loading…
Reference in New Issue