listImagesCmd().withImageNameFilter("blang/latex:ubuntu") returns all local images
See original GitHub issueHi there,
This used to work and I’ve updated my Docker Desktop for Mac version to the latest, currently 3.0.3 (51017) and it’s not working anymore. I’m not 100% sure this is caused by this upgrade but it could be.
I was using Docker-java 3.2.5 and I’ve upgraded to 3.2.7 in the hope that it would fix it but it didn’t and I get all the local images listed:

The code that I have:
DockerClient dockerClient = getDockerClient();
List<Image> images =
dockerClient.listImagesCmd().withImageNameFilter("blang/latex:ubuntu").exec();
Where getDockerClient()
is:
private DockerClient getDockerClient()
{
DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().build();
DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
.dockerHost(config.getDockerHost())
.sslConfig(config.getSSLConfig())
.build();
return DockerClientImpl.getInstance(config, httpClient);
}
Any idea?
Thanks a lot
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
With Docker 20.10.0 listImages filter no longer works #1516
With 20.10.0 docker removed the filter parameter when listing images. ... return dockerClient.listImagesCmd() .withImageNameFilter("mongo:4.2") .
Read more >ListImagesCmd.withImageNameFilter - Java - Tabnine
Check whether the image is available locally and pull it otherwise */ public void checkAndPullImage(DockerClient client, String image) { List<Image> images ...
Read more >ListImagesCmdImpl (docker-java 3.0.8 API) - javadoc.io
Description copied from interface: ListImagesCmd. Show all images (by default filter out the intermediate images used to build).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Perfect, thanks!
@vmassol glad to be helpful! Setting the API version would preserve the backward compatibility, just it is not set by default 😃
See https://github.com/testcontainers/testcontainers-java/blob/0e8523db9df728a31c2b951eeee08abf7196ec6f/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java#L243 for an example of how to set the API version 😃