This is an automated email from the ASF dual-hosted git repository.
HoustonPutman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 48a8565f384 Prune unused local-build Solr Docker images (#5302)
48a8565f384 is described below
commit 48a8565f384034202702c8cba37923fb3046c386
Author: Houston Putman <[email protected]>
AuthorDate: Fri Nov 6 09:19:04 2026 -0800
Prune unused local-build Solr Docker images (#5302)
---
solr/docker/build.gradle | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/solr/docker/build.gradle b/solr/docker/build.gradle
index 05fa30e3e45..f61e148489d 100644
--- a/solr/docker/build.gradle
+++ b/solr/docker/build.gradle
@@ -255,6 +255,21 @@ task dockerTag(dependsOn: tasks.dockerBuild) {
}
}
+// Removes the dangling Solr images that retagging leaves behind, identified
by the label from the Dockerfile
+task dockerPrune() {
+ group = 'Docker'
+ description = 'Remove dangling Solr docker images'
+
+ doLast {
+ execOps.exec {
+ ignoreExitValue = true
+ standardOutput = new ByteArrayOutputStream()
+ commandLine "docker", "image", "prune", "--force", "--filter",
"label=org.opencontainers.image.title=Apache Solr"
+ }
+ }
+}
+tasks.dockerTag.finalizedBy tasks.dockerPrune
+
task testDocker(type: TestDockerImageTask, dependsOn: tasks.dockerBuild) {
group = 'Docker'
description = 'Test Solr docker image built from the local Dockerfile'