Use Java version wildcard in image building docs
Fixes gh-22916
This commit is contained in:
		
							parent
							
								
									c59b48b690
								
							
						
					
					
						commit
						005ed8b8db
					
				| 
						 | 
					@ -115,7 +115,8 @@ $ gradle bootBuildImage --builder=mine/java-cnb-builder --runImage=mine/java-cnb
 | 
				
			||||||
==== Builder Configuration
 | 
					==== Builder Configuration
 | 
				
			||||||
If the builder exposes configuration options, those can be set using the `environment` property.
 | 
					If the builder exposes configuration options, those can be set using the `environment` property.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The following example assumes that the default builder defines a `BP_JVM_VERSION` property (typically used to customize the JDK version the image should use):
 | 
					The following example assumes that the default builder recognizes a `BP_JVM_VERSION` property.
 | 
				
			||||||
 | 
					This property is typically used to customize the JDK version the image should use by specifying the major version and a wildcard for the rest of the version:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
 | 
					[source,groovy,indent=0,subs="verbatim,attributes",role="primary"]
 | 
				
			||||||
.Groovy
 | 
					.Groovy
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,12 +9,12 @@ bootJar {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// tag::env[]
 | 
					// tag::env[]
 | 
				
			||||||
bootBuildImage {
 | 
					bootBuildImage {
 | 
				
			||||||
	environment = ["BP_JVM_VERSION" : "13.0.1"]
 | 
						environment = ["BP_JVM_VERSION" : "8.*"]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// end::env[]
 | 
					// end::env[]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
task bootBuildImageEnvironment {
 | 
					task bootBuildImageEnvironment {
 | 
				
			||||||
	doFirst {
 | 
						doFirst {
 | 
				
			||||||
		bootBuildImage.environment.each { name, value -> println "$name=$value" } 		
 | 
							bootBuildImage.environment.each { name, value -> println "$name=$value" }
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ plugins {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// tag::env[]
 | 
					// tag::env[]
 | 
				
			||||||
tasks.getByName<BootBuildImage>("bootBuildImage") {
 | 
					tasks.getByName<BootBuildImage>("bootBuildImage") {
 | 
				
			||||||
	environment = mapOf("BP_JVM_VERSION" to "13.0.1")
 | 
						environment = mapOf("BP_JVM_VERSION" to "8.*")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// end::env[]
 | 
					// end::env[]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,7 +152,8 @@ The builder and run image can be specified on the command line as well, as shown
 | 
				
			||||||
==== Builder Configuration
 | 
					==== Builder Configuration
 | 
				
			||||||
If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
 | 
					If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The following example assumes that the default builder defines a `BP_JVM_VERSION` property (typically used to customize the JDK version the image should use):
 | 
					The following example assumes that the default builder recognizes a `BP_JVM_VERSION` property.
 | 
				
			||||||
 | 
					This property is typically used to customize the JDK version the image should use by specifying the major version and a wildcard for the rest of the version:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[source,xml,indent=0,subs="verbatim,attributes"]
 | 
					[source,xml,indent=0,subs="verbatim,attributes"]
 | 
				
			||||||
----
 | 
					----
 | 
				
			||||||
| 
						 | 
					@ -166,7 +167,7 @@ The following example assumes that the default builder defines a `BP_JVM_VERSION
 | 
				
			||||||
					<configuration>
 | 
										<configuration>
 | 
				
			||||||
						<image>
 | 
											<image>
 | 
				
			||||||
							<env>
 | 
												<env>
 | 
				
			||||||
								<BP_JVM_VERSION>13.0.1</BP_JVM_VERSION>
 | 
													<BP_JVM_VERSION>8.*</BP_JVM_VERSION>
 | 
				
			||||||
							</env>
 | 
												</env>
 | 
				
			||||||
						</image>
 | 
											</image>
 | 
				
			||||||
					</configuration>
 | 
										</configuration>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue