问题记录
# 1. dockerfile 发布无法修改 jvm 参数
1. ENTRYPOINT 运行有两种方式
exec 模式和 shell 模式
shell格式: <instruction> <command>
exec格式 : <instruction> ["executable", "param1", "param2", ...]
2.
(i) shell 方式
dockerfile中:
ENTRYPOINT exec java -Duser.timezone=GMT+8 --add-opens java.base/java.lang=ALL-UNNAMED org.springframework.boot.loader.JarLauncher
ENTRYPOINT ["sh","-c","java", "--add-opens java.base/java.lang=ALL-UNNAMED", "org.springframework.boot.loader.JarLauncher"]
(ii) exec 模式
dockerfile中:
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
pom 中修改:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Add-Opens>java.base/java.lang=ALL-UNNAMED
</Add-Opens>
</manifestEntries>
</archive>
</configuration>
</plugin>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 2.
1