Skip to content

Commit

Permalink
Merge pull request #25427 from benkard/feature/appcds-nodocker
Browse files Browse the repository at this point in the history
AppCDS: Make container-based generation opt-out
  • Loading branch information
geoand authored May 11, 2022
2 parents 221d866 + b2020b7 commit 9873e60
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,27 @@ public class PackageConfig {
@ConfigItem
public Optional<String> appcdsBuilderImage;

/**
* Whether creation of the AppCDS archive should run in a container if available.
*
* <p>
* Normally, if either a suitable container image to create the AppCDS archive inside of
* can be determined automatically or if one is explicitly set using the
* {@code quarkus.package.appcds-builder-image} setting, the AppCDS archive is generated by
* running the JDK contained in the image as a container.
*
* <p>
* If this option is set to {@code false}, a container will not be used to generate the
* AppCDS archive. Instead, the JDK used to build the application is also used to create the
* archive. Note that the exact same JDK version must be used to run the application in this
* case.
*
* <p>
* Ignored if {@code quarkus.package.create-appcds} is set to {@code false}.
*/
@ConfigItem(defaultValue = "true")
public boolean appcdsUseContainer;

/**
* This is an advanced option that only takes effect for the mutable-jar format.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ public void build(Optional<AppCDSRequestedBuildItem> appCDsRequested,

private String determineContainerImage(PackageConfig packageConfig,
Optional<AppCDSContainerImageBuildItem> appCDSContainerImage) {
if (packageConfig.appcdsBuilderImage.isPresent()) {
if (!packageConfig.appcdsUseContainer) {
return null;
} else if (packageConfig.appcdsBuilderImage.isPresent()) {
return packageConfig.appcdsBuilderImage.get();
} else if (appCDSContainerImage.isPresent()) {
return appCDSContainerImage.get().getContainerImage();
Expand Down

0 comments on commit 9873e60

Please sign in to comment.