Docker unknown shorthand flag: 'a' in -aq)

后端 未结 2 1886
独厮守ぢ
独厮守ぢ 2020-11-30 14:30

I have multiple docker (version 18.09.0, build 4d60db4) containers running and I wish to stop them all at once. This blog post shows concisely exactly how to achieve this, g

相关标签:
2条回答
  • 2020-11-30 14:51

    In your Windows shell, you can do:

    FOR /f "tokens=*" %i IN ('docker ps -q') DO docker stop %i
    

    Taken from other question: Stop all docker containers at once on Windows

    0 讨论(0)
  • 2020-11-30 14:52

    You can also run your command - docker stop $(docker ps -aq) in PowerShell or GitBash; I would think it is because the $(docker ps -aq) part of the command is Linux command.

    0 讨论(0)
提交回复
热议问题