From c1ba08dccd220c91052782f55d8c69fd53ff39e0 Mon Sep 17 00:00:00 2001 From: retgal Date: Tue, 9 Jun 2026 21:29:35 +0200 Subject: [PATCH] feat: enhance core dockerfile Signed-off-by: retgal --- .docker/core.bake.Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.docker/core.bake.Dockerfile b/.docker/core.bake.Dockerfile index 667ebf1edb..d06ac2529f 100644 --- a/.docker/core.bake.Dockerfile +++ b/.docker/core.bake.Dockerfile @@ -15,7 +15,7 @@ FROM ubuntu:22.04 AS vcpkg-base ENV DEBIAN_FRONTEND=noninteractive # Install system dependencies - RUN apt-get update && apt-get install -y \ + RUN apt-get update && apt-get install -yq --no-install-recommends \ ca-certificates \ git \ curl \ @@ -88,9 +88,8 @@ FROM vcpkg-${NUGET_CACHE} AS core-base # so the vcpkg-base git-clone+bootstrap layer remains cacheable even when # GitHub CDN is unreachable in network-restricted build environments. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ - apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - git curl sudo wget ssh gpg \ + apt-get update && apt-get install -yq --no-install-recommends \ + git curl sudo wget ssh gpg ccache \ build-essential make ninja-build pkg-config \ libglib2.0-dev \ python3 python-is-python3 python3-venv python3-setuptools \ @@ -109,7 +108,7 @@ FROM vcpkg-${NUGET_CACHE} AS core-base gpg --dearmor -o /etc/apt/keyrings/llvm-snapshot.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-13 main" \ > /etc/apt/sources.list.d/llvm-13.list && \ - apt-get update && apt-get install -y \ + apt-get update && apt-get install -yq --no-install-recommends \ clang-13 lld-13 llvm-13-dev llvm-13 \ libc++-13-dev libc++abi-13-dev \ qemu-user-static binfmt-support && \ @@ -129,9 +128,6 @@ FROM vcpkg-${NUGET_CACHE} AS core-base # Git needs to allow repo paths copied by Docker RUN git config --global --add safe.directory '*' - # upstream behavior — unchanged - COPY core /core - ENV BUILD_ROOT=${BUILD_ROOT} @@ -139,6 +135,10 @@ FROM vcpkg-${NUGET_CACHE} AS core-base FROM core-base AS core ARG NUGET_SOURCE_PATH ARG TARGETARCH + + # copy sources right before the final build stage + COPY core /core + RUN --mount=type=cache,target=/build-cache \ --mount=type=bind,source=${NUGET_SOURCE_PATH},target=/nuget-cache,rw \ mkdir -p ${BUILD_ROOT} && \