Update Dockerfile to use Maven image with domestic repository settings for improved dependency download speed.

This commit is contained in:
liu
2026-02-03 11:40:24 +08:00
parent caf0d97903
commit f3b6d6d948
2 changed files with 54 additions and 2 deletions

View File

@@ -1,8 +1,11 @@
# ========== 阶段一Maven 构建 ==========
FROM eclipse-temurin:8-jdk-alpine AS builder
# ========== 阶段一Maven 构建(使用带 Maven 的镜像 + 国内源) ==========
FROM maven:3.9-eclipse-temurin-8-alpine AS builder
WORKDIR /build
# 使用阿里云 Maven 镜像,加速依赖下载
COPY docker/maven-settings.xml /root/.m2/settings.xml
# 先只复制 pom利用 Docker 缓存依赖层
COPY pom.xml .
RUN mvn dependency:go-offline -B -q