SpringのDocker Image作る
#Spring #Docker
とりあえず何も考えずにBuildPack使うのがよさげ (実際便利!!)
https://twitter.com/making/status/1273046601846554625
Docker file作らなくてもとりあえずこれを叩けばいい感じのDocker image作ってくれるということらしい
https://spring.pleiades.io/spring-boot/docs/current/reference/html/container-images.html#container-images.buildpacks
./mvnw spring-boot:build-image でやれば起動できる
https://qiita.com/omix222/items/d305f68f3f021529ec94
image名を指定するときはこんな感じ
https://spring.pleiades.io/guides/gs/spring-boot-docker/#_build_a_docker_image_with_maven
こんな感じで、package phaseでimageが作られるように書いておくのが楽そう
code: pom.xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>build-docker-image</id>
<phase>package</phase>
<goals>
<goal>build-image</goal>
</goals>
<configuration>
<imageName>webflux-sandbox-fooo:${version}</imageName>
</configuration>
</execution>
</executions>
</plugin>