From 7b0689c230c50b40279b47530d091524f5331934 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Wed, 17 Jun 2026 13:16:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker):=20=E5=8A=A0=20ARG=20CACHE=5FBUST?= =?UTF-8?q?=20=E5=BC=BA=E5=88=B6=E6=AF=8F=E6=AC=A1=20commit=20=E9=87=8D?= =?UTF-8?q?=E5=BB=BA=E6=BA=90=E7=A0=81=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows BuildKit --cache-from 不能正确失效源码 COPY 层, 通过传入 git SHA 作为 CACHE_BUST 值来强制失效。 Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 27781d7..745dc2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,9 @@ RUN --mount=type=cache,target=/root/.m2 \ mvn -s /workspace/maven-settings.xml -pl ${SERVICE_MODULE} -am \ dependency:go-offline -q +# CACHE_BUST = git SHA,每次 commit 自动失效源码及后续所有层 +ARG CACHE_BUST=unknown + # Copy source — invalidates only the compile layer, not the deps layer COPY common ./common COPY im-sdk ./im-sdk