使用私有 docker 镜像仓库
<properties>
<docker.maintainer>统一Manven 版本依赖</docker.maintainer>
<docker.imageName>parent</docker.imageName>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<serverId>docker-hub</serverId>
<registryUrl>https://10.10.6.50:5000</registryUrl>
<dockerHost>https://10.10.12.205:2376</dockerHost>
<dockerCertPath>C:\Users\admin\.docker\machine\machines\manager</dockerCertPath>
<imageName>10.10.6.50:5000/${docker.imageName}:${project.version}</imageName>
<baseImage>java:8</baseImage>
<maintainer>${docker.maintainer}</maintainer>
<volumes>/tmp</volumes>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
maven setting.xml文件配置
<servers>
<server>
<id>docker-hub</id>
<username>foo</username>
<password>secret-password</password>
<configuration>
<email>foo@foo.bar</email>
</configuration>
</server>
</servers>
// email 也是必须填写的