ci: Support for arm64 docker builds
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
FROM messense/rust-musl-cross:armv7-musleabihf AS builder
|
||||
WORKDIR /usr/src
|
||||
|
||||
# Download and compile Rust dependencies in an empty project and cache as a separate Docker layer
|
||||
RUN USER=root cargo new --bin managarr-temp
|
||||
RUN apt update && apt install -y libssl-dev pkg-config
|
||||
|
||||
WORKDIR /usr/src/managarr-temp
|
||||
COPY Cargo.* .
|
||||
RUN cargo build --release
|
||||
# remove src from empty project
|
||||
RUN rm -r src
|
||||
COPY src ./src
|
||||
# remove previous deps
|
||||
RUN rm ./target/armv7-unknown-linux-musleabihf/release/deps/managarr*
|
||||
|
||||
RUN --mount=type=cache,target=/volume/target \
|
||||
--mount=type=cache,target=/root/.cargo/registry \
|
||||
cargo build --release --bin managarr
|
||||
RUN mv target/armv7-unknown-linux-musleabihf/release/managarr .
|
||||
|
||||
FROM debian:stable-slim
|
||||
|
||||
# Copy the compiled binary from the builder container
|
||||
COPY --from=builder --chown=nonroot:nonroot /usr/src/managarr-temp/managarr /usr/local/bin
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/managarr" ]
|
||||
Reference in New Issue
Block a user