parent
7ad538cd84
commit
de321b00b7
@ -0,0 +1,24 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{gradle-project-version}'
|
||||
}
|
||||
|
||||
tasks.named("bootJar") {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named("bootBuildImage") {
|
||||
docker {
|
||||
host = "unix:///run/user/1000/podman/podman.sock"
|
||||
bindHostToBuilder = true
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.bootBuildImage.docker.host}")
|
||||
println("bindHostToBuilder=${tasks.bootBuildImage.docker.bindHostToBuilder}")
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{gradle-project-version}"
|
||||
}
|
||||
|
||||
tasks.named<BootJar>("bootJar") {
|
||||
mainClass.set("com.example.ExampleApplication")
|
||||
}
|
||||
|
||||
// tag::docker-host[]
|
||||
tasks.named<BootBuildImage>("bootBuildImage") {
|
||||
docker {
|
||||
host = "unix:///run/user/1000/podman/podman.sock"
|
||||
isBindHostToBuilder = true
|
||||
}
|
||||
}
|
||||
// end::docker-host[]
|
||||
|
||||
tasks.register("bootBuildImageDocker") {
|
||||
doFirst {
|
||||
println("host=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.host}")
|
||||
println("bindHostToBuilder=${tasks.getByName<BootBuildImage>("bootBuildImage").docker.isBindHostToBuilder}")
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- tag::docker-podman[] -->
|
||||
<project>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<docker>
|
||||
<host>unix:///run/user/1000/podman/podman.sock</host>
|
||||
<bindHostToBuilder>true</bindHostToBuilder>
|
||||
</docker>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
<!-- end::docker-podman[] -->
|
||||
|
Loading…
Reference in New Issue