docker container ls -f name=foo
returns all containers which have names that contain foo. This means it also return a container named foobar
, for example. How can I filter for all the containers named exactly foo?
docker container ls -f name=^/foo$
It can be achieved by using a regular expression. The caret ^
matches the exact start of the name and the dollar $
matches the end.
The slash /
is needed because the filter mechanism expects the name prefixed with a slash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With