feat: add support for arm64 (#142)

- set explicit action permissions
- make package owner dynamic so forks can test workflow
- build multi platform images using cross compilation amd64 -> arm64
- add a scope to buildx gha cache
This commit is contained in:
Tim Davis
2023-03-15 14:39:54 -07:00
parent b7b70346b4
commit 32a294a64a
5 changed files with 105 additions and 33 deletions

View File

@@ -1,12 +1,27 @@
# Build Stage
FROM rustlang/rust:nightly-slim AS builder
FROM --platform="${BUILDPLATFORM}" rustlang/rust:nightly-slim
USER 0:0
WORKDIR /home/rust/src
# Install build requirements
RUN apt-get update && apt-get install -y libssl-dev pkg-config
ARG TARGETARCH
# Build all crates
# Install build requirements
RUN dpkg --add-architecture "${TARGETARCH}"
RUN apt-get update && \
apt-get install -y \
make \
pkg-config \
libssl-dev:"${TARGETARCH}"
COPY scripts/build-image-layer.sh /tmp/
RUN sh /tmp/build-image-layer.sh tools
# Build all dependencies
COPY Cargo.toml Cargo.lock ./
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
COPY crates/delta/Cargo.toml ./crates/delta/
COPY crates/quark/Cargo.toml ./crates/quark/
RUN sh /tmp/build-image-layer.sh deps
# Build all apps
COPY crates ./crates
RUN cargo build --locked --release
RUN sh /tmp/build-image-layer.sh apps