Title: ListImagesCmd#withImageNameFilter is not working anymore with Docker API 1.41+ · Issue #2557 · docker-java/docker-java · GitHub
Open Graph Title: ListImagesCmd#withImageNameFilter is not working anymore with Docker API 1.41+ · Issue #2557 · docker-java/docker-java
X Title: ListImagesCmd#withImageNameFilter is not working anymore with Docker API 1.41+ · Issue #2557 · docker-java/docker-java
Description: Hello, we noticed recently a regression after upgrading the version of Docker in one of our machine related to a test using ListImagesCmd#withImageNameFilter to find if a docker image was locally present before creating it. So, for examp...
Open Graph Description: Hello, we noticed recently a regression after upgrading the version of Docker in one of our machine related to a test using ListImagesCmd#withImageNameFilter to find if a docker image was locally p...
X Description: Hello, we noticed recently a regression after upgrading the version of Docker in one of our machine related to a test using ListImagesCmd#withImageNameFilter to find if a docker image was locally p...
Opengraph URL: https://github.com/docker-java/docker-java/issues/2557
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ListImagesCmd#withImageNameFilter is not working anymore with Docker API 1.41+","articleBody":"Hello, \n\nwe noticed recently a regression after upgrading the version of Docker in one of our machine related to a test using `ListImagesCmd#withImageNameFilter` to find if a docker image was locally present before creating it. \n\nSo, for example, I have locally an image named `xwiki-tomcat-jre25-office:b372e3023b3b21630385b22e1b19c70eaef70364988917e6d27613341c951536`, which also has a specific label `\"image-version\": \"LO-25.2.7\"`. If I use the CLI to search for an image with a name containing a different hash such as: \n\n\u003e docker images xwiki-tomcat-jre25-office:71af718ae80d90b93c3b3c36eb9b0cf9e102e845b260d1f1e33a07fbda511322 --filter \"label=image-version=LO-25.2.7\"\n\nThen the command line properly returns no result. \n\nHowever, when I use the following snippet using docker-java: \n```\nDockerClient dockerClient = DockerClientImpl.getInstance(config, httpClient);\n List\u003cImage\u003e imageList = dockerClient.listImagesCmd()\n .withImageNameFilter(\n \"xwiki-tomcat-jre25-office:71af718ae80d90b93c3b3c36eb9b0cf9e102e845b260d1f1e33a07fbda511322\")\n .withLabelFilter(Map.of(\"image-version\", \"LO-25.2.7\"))\n .exec();\n```\nI now obtain in the list one occurence, the image \n`xwiki-tomcat-jre25-office:b372e3023b3b21630385b22e1b19c70eaef70364988917e6d27613341c951536`, while I'm expecting the list to be empty. And before the upgrade of the Docker packages on the machine, the list was empty. \n\nAfter investigation this is apparently because docker-java performs the following request:\n\u003e 11:27:14.576 [main] TRACE o.t.s.c.g.d.c.exec.ListImagesCmdExec - GET: DefaultWebTarget{path=[/images/json], queryParams={filter=[xwiki-tomcat-jre25-office:71af718ae80d90b93c3b3c36eb9b0cf9e102e845b260d1f1e33a07fbda511322], filters=[{\"label\":[\"image-version=LO-25.2.7\"]}]}}\n\nYou can note the presence of `queryParams={filter=[xwiki-tomcat-jre25-office:71af718ae80d90b93c3b3c36eb9b0cf9e102e845b260d1f1e33a07fbda511322]`. And apparently this `filter` query param has been removed from Docker API since version 1.41, see [in release notes](https://docs.docker.com/reference/api/engine/version-history/#v141-api-changes): \n\u003e The filter (singular) query parameter, which was deprecated in favor of the filters option in Docker 1.13, has now been removed from the GET /images/json endpoint. The parameter remains available when using API version 1.40 or below.\n\nSo IMO the `ListImagesCmd#withImageNameFilter` API is now broken with recent versions of Docker API. Either it should be fixed, or at the very least it should be deprecated / some javadoc should be added to inform that it might not work as expected. ","author":{"url":"https://github.com/surli","@type":"Person","name":"surli"},"datePublished":"2025-12-12T13:16:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/2557/docker-java/issues/2557"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c126baa7-7263-ee8e-016d-b54d5a8ebadb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99FC:2D454F:28C15FC:3640890:6971C88D |
| html-safe-nonce | 5a74ab98cee7aa324f2e53c43d23e0517305618e6e190af4d5c1f29b0b321c70 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUZDOjJENDU0RjoyOEMxNUZDOjM2NDA4OTA6Njk3MUM4OEQiLCJ2aXNpdG9yX2lkIjoiMjA2OTc4MTI1MzIyODQ0Nzg4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ad6a3d92550e1a34bb62e349cd0eeeafa5614ac070911baecde4c5b37c24b16f |
| hovercard-subject-tag | issue:3723395739 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-java/docker-java/2557/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68e0ad6f98d59d1e646738b27124e8da97c9a124e2f62090c908f2d1a99cadd5/docker-java/docker-java/issues/2557 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68e0ad6f98d59d1e646738b27124e8da97c9a124e2f62090c908f2d1a99cadd5/docker-java/docker-java/issues/2557 |
| og:image:alt | Hello, we noticed recently a regression after upgrading the version of Docker in one of our machine related to a test using ListImagesCmd#withImageNameFilter to find if a docker image was locally p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | surli |
| hostname | github.com |
| expected-hostname | github.com |
| None | ac615aa66802dad9a938c6abe95edf09ee43c0c7f508315b64b08612858ef32e |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git |
| octolytics-dimension-user_id | 7772003 |
| octolytics-dimension-user_login | docker-java |
| octolytics-dimension-repository_id | 20415251 |
| octolytics-dimension-repository_nwo | docker-java/docker-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20415251 |
| octolytics-dimension-repository_network_root_nwo | docker-java/docker-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6b618569a5f93e0b31f97f620112341421ef5f69 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width