1、推送的前提是安装本地Docker
2、更改docker配置为:
{"registry-mirrors": ["https://2w5oblrm.mirror.aliyuncs.com","https://hub-mirror.c.163.com/"],"insecure-registries": ["192.168.252.162:8899"],"debug": true,"experimental": false}
3、更改POM文件
<!-- 推荐使用Harbor -->
<docker.registry.url>192.168.252.162:8899</docker.registry.url>
<docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host>
<docker.username>admin</docker.username>
<docker.password>Harbor12345</docker.password>
<docker.namespace>eman</docker.namespace>
<docker.plugin.version>1.4.13</docker.plugin.version>
4、更改Maven setting.xml
<server>
<id>192.168.252.162:8899</id>
<username>admin</username>
<password>Harbor12345</password>
<configuration>
<email>wyb@oureman.com</email>
</configuration>
</server>
5、把包推送到Harbor私服中
mvn clean package dockerfile:push
