Allow image Created date to be configurable

A `createdDate` option on the Maven `spring-boot:build-image` goal
and the Gradle `bootBuildImage` task can be used to set the `Created`
metadata field on a generated OCI image to a specified date or to
the current date.

Closes gh-28798
This commit is contained in:
Scott Frederick
2023-04-05 13:05:48 -05:00
parent cacc563fc0
commit 5817c8441d
68 changed files with 542 additions and 71 deletions

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
bindings = [ "${projectDir}/bindings/ca-certificates:/platform/bindings/certificates" as String ]
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildpacks = [ "spring-boot/test-info" ]
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildpacks = [ "file://${projectDir}/buildpack/hello-world" as String ]
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildpacks = [ "file://${projectDir}/hello-world.tgz" as String ]
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildpacks = ["projects.registry.vmware.com/springboot/test-info:latest"]
}

View File

@@ -0,0 +1,10 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
createdDate = "2020-07-01T12:34:56Z"
}

View File

@@ -0,0 +1,10 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
createdDate = "now"
}

View File

@@ -8,7 +8,7 @@ targetCompatibility = '1.8'
bootBuildImage {
imageName = "example/test-image-custom"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
runImage = "projects.registry.vmware.com/springboot/run:tiny-cnb"
pullPolicy = "IF_NOT_PRESENT"
}

View File

@@ -8,6 +8,6 @@ targetCompatibility = '1.8'
bootBuildImage {
imageName = "example/test-image-name"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
}

View File

@@ -11,6 +11,6 @@ bootJar {
}
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
}

View File

@@ -11,7 +11,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
network = "none"
}

View File

@@ -13,6 +13,6 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = PullPolicy.ALWAYS
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
tags = [ "example.com/myapp:latest" ]
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildCache {
volume {

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
archiveFile = bootWar.archiveFile
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
buildCache {
volume {
name = "build-cache-volume1"

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
environment = ["FORCE_FAILURE": "true"]
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
buildpacks = [ "urn:cnb:builder:example/does-not-exist:0.0.1" ]
}

View File

@@ -0,0 +1,10 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
createdDate = "invalid date"
}

View File

@@ -7,7 +7,7 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
tags = [ "example/Invalid-Tag-Name" ]
}

View File

@@ -11,6 +11,6 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
pullPolicy = "IF_NOT_PRESENT"
}

View File

@@ -7,6 +7,6 @@ sourceCompatibility = '1.8'
targetCompatibility = '1.8'
bootBuildImage {
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.2"
publish = true
}