How to list containers that are using redis/ubuntu image in Docker
I think you want the ancestor filter :

From the Docker Docs on ps:


  ancestor - Filters containers which share a given image as an ancestor. Expressed as image-name[:&lt;tag&gt;], image id, or image@digest


$docker run -d --rm redis 
c4cf36467d63c66f7d3d8271dd0f8e51ede4a627048eb5e294a2445f5b0d30ef
$ docker ps -f "ancestor=redis"
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
c4cf36467d63        redis               "docker-entrypoint.s…"   16 seconds ago      Up 15 seconds       6379/tcp            elated_yonath