Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check how many containers are running a certain docker image?

I want to check how many containers are running an image, I could do that using docker ps --filter ancestor ="imagename" and then count the number of containers.But my machine does not support this command is there another way to do it?

like image 955
Said Saifi Avatar asked Jul 19 '16 13:07

Said Saifi


1 Answers

How about

docker ps | grep imagename | wc -l
like image 197
Michael Avatar answered Oct 15 '22 14:10

Michael