forked from jmug/stoatchat
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:
25
Dockerfile
25
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user