diff --git a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java index b9b06ee6bfe83..fa13ce661509e 100644 --- a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java +++ b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerConfig.java @@ -58,6 +58,12 @@ public class DockerConfig { @ConfigItem public Optional executableName; + /** + * Additional arbitrary arguments passed to the executable when building the container image. + */ + @ConfigItem + public Optional> additionalArgs; + /** * Configuration for Docker Buildx options */ diff --git a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java index a022914777641..a49290899d7be 100644 --- a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java +++ b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java @@ -258,7 +258,8 @@ private void loginToRegistryIfNeeded(ContainerImageConfig containerImageConfig, private String[] getDockerArgs(String image, DockerfilePaths dockerfilePaths, ContainerImageConfig containerImageConfig, DockerConfig dockerConfig, ContainerImageInfoBuildItem containerImageInfo, boolean pushImages) { - List dockerArgs = new ArrayList<>(6 + dockerConfig.buildArgs.size()); + List dockerArgs = new ArrayList<>(6 + dockerConfig.buildArgs.size() + dockerConfig.additionalArgs.map( + List::size).orElse(0)); boolean useBuildx = dockerConfig.buildx.useBuildx(); if (useBuildx) { @@ -303,6 +304,7 @@ private String[] getDockerArgs(String image, DockerfilePaths dockerfilePaths, Co dockerArgs.add("--network"); dockerArgs.add(network); }); + dockerConfig.additionalArgs.ifPresent(dockerArgs::addAll); dockerArgs.addAll(Arrays.asList("-t", image)); if (useBuildx) {