Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
3f942a4c
Commit
3f942a4c
authored
Mar 05, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
8137db80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
24 deletions
+5
-24
yd-csf-api/Dockerfile
+5
-24
No files found.
yd-csf-api/Dockerfile
View file @
3f942a4c
# 第一阶段:使用完整 JDK 提取定制 JRE(仅包含应用所需模块)
FROM
eclipse-temurin:8-jdk-alpine AS jre-builder
RUN
jlink
\
--module-path
/opt/java/openjdk/jmods
\
--verbose
\
--add-modules
java.base,java.logging,java.sql,java.management,java.naming
\
--output
/custom-jre
\
--strip-debug
\
--no-header-files
\
--no-man-pages
FROM
openjdk:8
# 第二阶段:极小的运行环境
FROM
alpine:latest
# 设置 Java 环境变量
ENV
JAVA_HOME=/opt/java
ENV
PATH="${JAVA_HOME}/bin:${PATH}"
# 复制定制 JRE
COPY
--from=jre-builder /custom-jre $JAVA_HOME
# 维护人信息
# 维护人
LABEL
maintainer="zxm<2060197959@qq.com>"
# 创建
应用目录
# 创建
目录(Alpine 命令相同)
RUN
mkdir
-p
/home/app
#
复制 Spring Boot 可执行
jar
#
拷贝项目
jar
COPY
target/yd-csf-api-1.0-SNAPSHOT-exec.jar /home/app/yd-csf-api.jar
# 启动命令(内存参数可保留
或按需调整
)
# 启动命令(内存参数可保留)
ENTRYPOINT
["java", "-Xmx256m", "-Xms128m", "-jar", "/home/app/yd-csf-api.jar"]
# 暴露端口
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment