You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
821 B
Docker

3 years ago
# syntax = docker/dockerfile:1.2.1
3 years ago
FROM rust:latest as builder
3 years ago
USER root
WORKDIR /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"
3 years ago
RUN --mount=type=cache,target=/rust-src/target \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/root/.cargo/registry \
3 years ago
cargo build --release --target "$(uname -m)-unknown-linux-musl" -p dockerfile-plus
3 years ago
RUN --mount=type=cache,target=/rust-src/target \
cp "/rust-src/target/$(uname -m)-unknown-linux-musl/release/dockerfile-plus" /usr/local/bin/dockerfile-plus
3 years ago
FROM docker/dockerfile:1.2.1
COPY --from=builder /usr/local/bin/dockerfile-plus /usr/local/bin/dockerfile-plus
ENTRYPOINT ["/usr/local/bin/dockerfile-plus"]