<build> <plugins> <!-- <plugin>--> <!-- <groupId>org.springframework.boot</groupId>--> <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> <!-- <version>2.0.1.RELEASE</version>--> <!--<!– <executions>–>--> <!--<!– <execution>–>--> <!--<!– <goals>–>--> <!--<!– <goal>repackage</goal>–>--> <!--<!– </goals>–>--> <!--<!– </execution>–>--> <!--<!– </executions>–>--> <!-- </plugin>--> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>1.2.1</version> <configuration> <imageName>${docker.prefix}${project.artifactId}:${docker.version}</imageName> <serverId>my-docker-registry</serverId> <dockerDirectory>${project.basedir}</dockerDirectory> <dockerHost>${dockHost.zdiot}</dockerHost> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>${project.build.finalName}</include> </resource> </resources> </configuration> <executions> <execution> <id>build-image</id> <phase>package</phase> <goals> <goal>build</goal> </goals> </execution><!-- <execution>--><!-- <id>tag-image</id>--><!-- <phase>package</phase>--><!-- <goals>--><!-- <goal>tag</goal>--><!-- </goals>--><!-- <configuration>--><!-- <image>${docker.prefix}${project.artifactId}:latest</image>--><!-- <newName>${docker.prefix}${project.artifactId}:${docker.version}</newName>--><!-- </configuration>--><!-- </execution>--> <execution> <id>push-image</id> <phase>install</phase> <goals> <goal>push</goal> </goals> <configuration> <imageName>registry.cn-hangzhou.aliyuncs.com/yuanlang/the-first-blood/zdiot-gateway-springcloud:beta1</imageName> </configuration> </execution> </executions> </plugin> </plugins> </build>