Docker Community Forums

Share and learn in the Docker community.

What filters are available for `docker-compose ps`?

The docker-compose ps doc does not say what filters we can use. The docker ps doc says docker ps supports the health filter, but evidently docker-compose ps does not:

$ docker-compose ps --service --filter "health=healthy"
ERROR: Invalid filter: health

Where do we find what filters are available?

Ultimately, I’d like docker-compose up --detach to wait for all containers to finish starting up before docker-compose exits so I know that it has happened without having to docker ps and look manually over and over.

According to the help page, you can filter by presumably any container property.

$ docker-compose help ps
 List containers.

 Usage: ps [options] [SERVICE...]

 -q, --quiet          Only display IDs
 --services           Display services
 --filter KEY=VAL     Filter services by a property