Docker Community Forums

Share and learn in the Docker community.

Docker ps: filter container by health=starting


(Joke de Buhr) #1

Hi,

I’m trying to get a list of all containers with health check command which are starting up. According to the documentation I tried the following command

docker ps -f health=starting

Unfortunately this doesn’t seem to be working:

docker ps -f health=starting
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Just displaying all containers show the container has a health and is starting up>

docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3b4d3ac1fc81 3dbf70913a12 "httpd-foreground" 16 seconds ago Up 15 seconds (health: starting) 80/tcp httpd

On the other hand filter for healthy or unhealthy containers works. Is this a bug or am I missing something?


(Sam) #2

yeh, the filter doesn’t seem to work (bug)… use a pipe and use grep to get the list…

docker ps | grep starting


(Joke de Buhr) #3

I did exactly that. Building a work around using pipes.
But as you can see in the docker ps documentation the filter argument health should support starting as argument.
And starting seems to be a recognized keyword:

docker ps -f health=stopping
Error response from daemon: Unrecognised filter value for health: stopping

This seems like a bug rather than a feature not being supported.


(Sam) #4

i agree bug… but in the meantime… i’ll fix my prior post


(Joke de Buhr) #5

I’m filling a bug report in this case. Thank you.