From aa159654673742d8d5c97b0429ee91b142de54aa Mon Sep 17 00:00:00 2001 From: fengsilin Date: Thu, 21 May 2026 10:11:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Dockerfile=20=E4=BD=BF=E7=94=A8=E5=8D=8E?= =?UTF-8?q?=E4=B8=BA=E4=BA=91=E9=95=9C=E5=83=8F=E6=BA=90=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E7=BD=91=E7=BB=9C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 # syntax 指令,将 Docker Hub 基础镜像替换为华为云 SWR 镜像,解决 WSL 环境下无法直连 Docker Hub 的问题。 --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7019a6a..22f87b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -# syntax=docker/dockerfile:1 - -FROM oven/bun:latest AS builder +FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/oven/bun:latest AS builder # 使用淘宝镜像加速 ENV BUN_INSTALL_REGISTRY=https://registry.npmmirror.com @@ -30,7 +28,7 @@ COPY . . COPY --from=builder /build/dist ./web/dist RUN --mount=type=cache,target=/root/.cache/go-build go build -ldflags "-s -w -X 'github.com/QuantumNous/new-api/common.Version=$(cat VERSION)'" -o new-api -FROM debian:bookworm-slim +FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/debian:bookworm-slim # 使用阿里云镜像源 RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources