From a80e80f17975b6b459518d0b4d7c8852d35d3313 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 3 Dec 2025 17:38:43 -0800 Subject: [PATCH] =?UTF-8?q?perf(mpc-system):=20=E6=B7=BB=E5=8A=A0=20Alpine?= =?UTF-8?q?=20=E9=95=9C=E5=83=8F=E5=8A=A0=E9=80=9F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为所有 Dockerfile 的 builder 和 final 阶段添加阿里云镜像源: - 使用 mirrors.aliyun.com 替代 dl-cdn.alpinelinux.org - 显著加速中国区 Docker 构建中的 apk 包下载 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/mpc-system/services/account/Dockerfile | 6 ++++++ backend/mpc-system/services/message-router/Dockerfile | 6 ++++++ backend/mpc-system/services/server-party/Dockerfile | 6 ++++++ backend/mpc-system/services/session-coordinator/Dockerfile | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/backend/mpc-system/services/account/Dockerfile b/backend/mpc-system/services/account/Dockerfile index 9706adab..f90d2d4d 100644 --- a/backend/mpc-system/services/account/Dockerfile +++ b/backend/mpc-system/services/account/Dockerfile @@ -1,6 +1,9 @@ # Build stage FROM golang:1.21-alpine AS builder +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + RUN apk add --no-cache git ca-certificates # Set Go proxy for China @@ -23,6 +26,9 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + RUN apk --no-cache add ca-certificates curl RUN adduser -D -s /bin/sh mpc diff --git a/backend/mpc-system/services/message-router/Dockerfile b/backend/mpc-system/services/message-router/Dockerfile index 597c9d19..2ab5be2b 100644 --- a/backend/mpc-system/services/message-router/Dockerfile +++ b/backend/mpc-system/services/message-router/Dockerfile @@ -1,6 +1,9 @@ # Build stage FROM golang:1.21-alpine AS builder +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + RUN apk add --no-cache git ca-certificates # Set Go proxy for China @@ -23,6 +26,9 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + RUN apk --no-cache add ca-certificates curl RUN adduser -D -s /bin/sh mpc diff --git a/backend/mpc-system/services/server-party/Dockerfile b/backend/mpc-system/services/server-party/Dockerfile index 44439963..c2b2a5f0 100644 --- a/backend/mpc-system/services/server-party/Dockerfile +++ b/backend/mpc-system/services/server-party/Dockerfile @@ -1,6 +1,9 @@ # Build stage FROM golang:1.21-alpine AS builder +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + RUN apk add --no-cache git ca-certificates # Set Go proxy for China @@ -23,6 +26,9 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + RUN apk --no-cache add ca-certificates curl RUN adduser -D -s /bin/sh mpc diff --git a/backend/mpc-system/services/session-coordinator/Dockerfile b/backend/mpc-system/services/session-coordinator/Dockerfile index 6e15cce6..d8c17735 100644 --- a/backend/mpc-system/services/session-coordinator/Dockerfile +++ b/backend/mpc-system/services/session-coordinator/Dockerfile @@ -1,6 +1,9 @@ # Build stage FROM golang:1.21-alpine AS builder +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + # Install dependencies RUN apk add --no-cache git ca-certificates @@ -30,6 +33,9 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + # Install ca-certificates and curl for HTTPS and health check RUN apk --no-cache add ca-certificates curl