This commit is contained in:
Mateusz Gruszczyński
2026-09-18 10:27:39 +02:00
parent 7d9e6c8189
commit 3ffb02595e
28 changed files with 610 additions and 480 deletions
+5 -3
View File
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.7
ARG RUST_VERSION=1.89
ARG RUST_VERSION=1.98.1
ARG XX_VERSION=1.9.0
# Cross-compilation helpers. Builder stages always run on BUILDPLATFORM, so an
@@ -16,11 +16,12 @@ RUN apt-get update \
# Fetch Rust dependencies before TARGETPLATFORM enters the cache chain, so the
# same registry/git cache is reused by amd64 and arm64 builds.
COPY Cargo.toml Cargo.lock ./
COPY Cargo.toml ./
RUN --mount=type=cache,id=gree-controller-cargo-registry,target=/usr/local/cargo/registry \
--mount=type=cache,id=gree-controller-cargo-git,target=/usr/local/cargo/git \
mkdir -p src \
&& printf 'fn main() {}\n' > src/main.rs \
&& cargo generate-lockfile \
&& cargo fetch --locked \
&& rm -rf src
@@ -56,11 +57,12 @@ WORKDIR /src
RUN apk add --no-cache clang lld llvm file pkgconf
# Keep dependency fetching architecture-independent here as well.
COPY Cargo.toml Cargo.lock ./
COPY Cargo.toml ./
RUN --mount=type=cache,id=gree-controller-cargo-registry,target=/usr/local/cargo/registry \
--mount=type=cache,id=gree-controller-cargo-git,target=/usr/local/cargo/git \
mkdir -p src \
&& printf 'fn main() {}\n' > src/main.rs \
&& cargo generate-lockfile \
&& cargo fetch --locked \
&& rm -rf src