From 5f491edff48b58cd40108fac18121cbebbed287a Mon Sep 17 00:00:00 2001 From: syadmin Date: Sat, 14 Nov 2026 01:49:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker):=20=E7=A7=BB=E9=99=A4=20go=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=20cache=20mount=20=E5=8A=A0?= =?UTF-8?q?=E9=80=9F=E6=9E=84=E5=BB=BA=EF=BC=88hxtesting=20=E4=B8=8A=20bui?= =?UTF-8?q?ldkit=20cache=20mount=20=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F=20?= =?UTF-8?q?IO=20=E6=9E=81=E6=85=A2=E5=AF=BC=E8=87=B4=20go=20mod=20download?= =?UTF-8?q?=20=E8=B6=85=E6=97=B6=EF=BC=89=EF=BC=9Bci:=20=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=20anydoc=EF=BC=88Rust=20=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=93=BE=E9=9C=80=E5=A4=96=E7=BD=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy-hxtesting.yml | 6 ++++-- docker/Dockerfile.app | 10 ++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deploy-hxtesting.yml b/.gitea/workflows/deploy-hxtesting.yml index a707824..8441b5a 100644 --- a/.gitea/workflows/deploy-hxtesting.yml +++ b/.gitea/workflows/deploy-hxtesting.yml @@ -30,8 +30,10 @@ jobs: run: | set -e cd "$DEPLOY_DIR" - bash scripts/build_images.sh -p - bash scripts/build_images.sh -f + # WITH_ANYDOC=0:跳过 anydoc 解析引擎(Rust 工具链需外网,hxtesting 不可达; + # 文档解析由 docreader 容器承担,测试环境不受影响) + WITH_ANYDOC=0 bash scripts/build_images.sh -p + WITH_ANYDOC=0 bash scripts/build_images.sh -f docker tag wechatopenai/weknora-app:latest wechatopenai/weknora-app:sha-${GIT_SHA} docker tag wechatopenai/weknora-ui:latest wechatopenai/weknora-ui:sha-${GIT_SHA} docker image prune -f --filter "until=168h" >/dev/null diff --git a/docker/Dockerfile.app b/docker/Dockerfile.app index 191b14d..59c316e 100644 --- a/docker/Dockerfile.app +++ b/docker/Dockerfile.app @@ -55,7 +55,7 @@ RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate # so that module's go.mod must exist before `go mod download`. COPY go.mod go.sum ./ COPY third_party/anydoc-go/go.mod third_party/anydoc-go/go.mod -RUN --mount=type=cache,target=/go/pkg/mod go mod download +RUN go mod download COPY cmd/download cmd/download # DuckDB extensions (spatial/excel): prefer a local seed tarball exported from # a previously built image (artifacts/duckdb_extensions/seed.tar) — @@ -69,7 +69,7 @@ RUN if [ -s /tmp/duckdb-seed.tar ]; then \ go run cmd/download/duckdb/duckdb.go; \ fi COPY . . -RUN --mount=type=cache,target=/go/pkg/mod bash ./scripts/copy-licenses.sh /license-bundle +RUN bash ./scripts/copy-licenses.sh /license-bundle # Get version and commit info for build injection ARG VERSION_ARG @@ -119,14 +119,12 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ # the layer (~2.7 GB), which occupies disk locally and is uploaded to the CI # layer cache. Mounted, the cache lives outside the layer and repeated builds # reuse compiled objects instead of recompiling from scratch. -RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - if [ "$WITH_ANYDOC" = "1" ]; then \ +RUN if [ "$WITH_ANYDOC" = "1" ]; then \ make build-prod GO_BUILD_TAGS=anydoc; \ else \ make build-prod; \ fi -RUN --mount=type=cache,target=/go/pkg/mod cp -r /go/pkg/mod/github.com/yanyiwu/ /app/yanyiwu/ +RUN cp -r /go/pkg/mod/github.com/yanyiwu/ /app/yanyiwu/ # Final stage FROM debian:12.12-slim