2

It's pretty straight forward to filter out docker volumes using: docker volume ls --filter "label=something"

However I want to run something like: docker volume ls --filter "label!=something"'

Some old StackOverflow answers said it's possible but I can't find it anywhere in the Docker docs. I also get this error when I try running the command:

Error response from daemon: Invalid filter 'label!'

Does anyone know a way to do it without using grep and piping?

M.Jin
  • 198
  • 1
  • 10
  • The documentation is very clear. It doesn't mention a negation operator, so I'd say that there isn't one. Presumably the devs decided that there was no need to duplicate functionality which is available very simply in the shell. – SiHa Feb 06 '20 at 07:50

1 Answers1

1

The official documentation for docker volume ls doesn't mention a way to do this. Hence we can safely assume that there is no direct way to do what you have asked.

Also suggested here: https://stackoverflow.com/a/31959682/737440

AmitP
  • 419
  • 4
  • 9