1、推送的前提是安装本地Docker
    2、更改docker配置为:

    1. {
    2. "registry-mirrors": [
    3. "https://2w5oblrm.mirror.aliyuncs.com",
    4. "https://hub-mirror.c.163.com/"
    5. ],
    6. "insecure-registries": [
    7. "192.168.252.162:8899"
    8. ],
    9. "debug": true,
    10. "experimental": false
    11. }

    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