Jib no need Docker daemon can build Java applications optimized Docker and OCI image - no understanding Docker best practices. It can be used as Maven and Gradle of plug-ins and Java library.
I am using the Maven plugin to upload, just write a few simple parameters, in the official website View in:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>
1.7
.
0
</version>
<configuration>
<from>
# 基础镜像 因为docker忘记账号密码了,使用的是阿里云自己上传的一份openjdk:
8
的镜像
<image>registry.cn-shenzhen.aliyuncs.com/zsifan/openjdk:
8
</image>
</from>
<to>
# 上传的镜像
<image>registry.cn-shenzhen.aliyuncs.com/zsifan/istio-b:v1</image>
</to>
# 容器在运行时公开的端口
<ports>
10002
</ports>
# 可以进行HTTP
<allowInsecureRegistries>
true
</allowInsecureRegistries>
</configuration>
</plugin>
|
from and to are to account password is not recommended to write here, you can write in the settings.xml in maven
1
2
3
4
5
6
7
8
9
|
# 在servers中编写
<servers>
<server>
# 该id字段应该是这些凭据用于的注册表服务器
<id>registry.cn-shenzhen.aliyuncs.com</id>
<username>账号</username>
<password>密码</password>
</server>
</servers>
|
Use the command: mvn compile jib: build to upload
This article is reproduced in: https://www.cnblogs.com/zsifan/p/11853133.html