From bb9dab30239f7d9fe0266d4d78766519945d952f Mon Sep 17 00:00:00 2001 From: 8ga Date: Mon, 27 Oct 2025 19:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=9E=84=E5=BB=BAJDK?= =?UTF-8?q?=E9=95=9C=E5=83=8F.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 构建JDK镜像.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 构建JDK镜像.md diff --git a/构建JDK镜像.md b/构建JDK镜像.md new file mode 100644 index 0000000..5c87b3b --- /dev/null +++ b/构建JDK镜像.md @@ -0,0 +1,27 @@ +## JDK21 +``` +FROM docker.1ms.run/eclipse-temurin:21-jdk +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \ + echo "deb https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \ + apt-get update && \ + apt-get install -y git maven && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* +``` + +## JDK8 +``` +FROM docker.1ms.run/maven:3.8.6-jdk-8 +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \ + echo "deb https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \ + echo "deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \ + apt-get update && \ + apt-get install -y git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* +``` \ No newline at end of file