Answers: <p>I think you want the <code>ancestor</code> filter :</p>
  
  <p>From the <a href="https://docs.docker.com/engine/reference/commandline/ps/" rel="nofollow noreferrer">Docker Docs on <code>ps</code></a>:</p>
  
  <blockquote>
    <p><code>ancestor</code> - Filters containers which share a given image as an ancestor. Expressed as <code>image-name[:&lt;tag&gt;]</code>, <code>image id</code>, or <code>image@digest</code></p>
  </blockquote>
  
  <pre><code>$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
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-08-02T09:38:02.930Z
Answers: 2019-08-02T10:16:45.093Z
Answers: 2019-08-02T10:16:45.093Z
Answers: Bruce Becker
Body: <p>I am trying to figure out the solution for the above question. I tried the  commands <code>docker ps -a -f "label=redis"</code> and <code>docker ps -f "name=redis"</code>, but that didn't gave any output.</p>
  
  <p>Any help?</p>
  
Tags: <docker>
Title: How to list containers that are using redis/ubuntu image in Docker
UserDisplayName: Nagesh Nagu
ThreadText: # How to list containers that are using redis/ubuntu image in Docker
  
  (Asked by: username_0 on 2019-08-02)
  
  I am trying to figure out the solution for the above question. I tried the commands `docker ps -a -f "label=redis"` and `docker ps -f "name=redis"`, but that didn't gave any output.
  
  Any help?
  
  **Tags:** docker
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-02. Score: 1
  
  I think you want the `ancestor` filter :
  
  From the [Docker Docs on `ps`](https://docs.docker.com/engine/reference/commandline/ps/):
  
  > `ancestor` - Filters containers which share a given image as an ancestor. Expressed as `image-name[:<tag>]`, `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
  
  ```
  
  
  ---
  
  