sping boot docker image
Posted XiaoMaPro
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sping boot docker image相关的知识,希望对你有一定的参考价值。
jib——pom.xml
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId> <configuration>
<from>
<image>java:8-jre-alpine</image>
</from>
<to>
<image>10.7.0.66:5000/mspro_eureka:1.0</image>
</to>
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
</plugin>
</plugins>
</build>
docker-maven——pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>$project.name</finalName>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.12</version>
<configuration>
<imageName>$registry.url/$project.name:0.0.1</imageName>
<dockerHost>$docker.url</dockerHost>
<dockerDirectory>$project.basedir</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>$project.build.directory</directory>
<include>$project.build.finalName.jar</include>
</resource>
</resources>
<serverId>docker-hub</serverId>
<registryUrl>https://index.docker.io/v1/</registryUrl>
</configuration>
</plugin>
</plugins>
</build>
pull
sudo docker pull 192.167.0.169:5000/mspro_eureka:1.0
run
sudo docker run --name dokername -p 8761:8761 -d 192.167.0.169:5000/mspro_eureka:1.0 --restart=always registry
#使用本机地址
docker run -i -t --net=host --name mspro_config -p 1993:1993 -d 192.168.0.169:5000/mspro_config:1.0.0 --restart=always registry
以上是关于sping boot docker image的主要内容,如果未能解决你的问题,请参考以下文章
D13 Sping Boot 入门 Sping框架--Java Web之Cookie和Session
D15 Sping Boot 入门 Sping框架--Java Web之书城项目 购物车模块
D08 Sping Boot 入门 Sping框架--Java Web之JSP
D16 Sping Boot 入门 Sping框架--Java Web之书城项目 dingda模块