Docker 未知速记标志:-aq 中的“a") [英] Docker unknown shorthand flag: 'a' in -aq)
问题描述
我有多个 docker(版本 18.09.0,构建 4d60db4)容器在运行,我希望一次停止它们.这篇博文准确地展示了如何实现这一目标,太棒了!
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, great!
我可以使用 docker ps -aq
列出所有容器并且没有问题.
I can list all containers using docker ps -aq
and have no issues.
但是,当尝试使用 docker ps -aq
的输出停止所有容器时,即 docker stop $(docker ps -aq)
,我收到以下错误:
However, when trying to stop all containers using the output of docker ps -aq
, i.e. docker stop $(docker ps -aq)
, I receive the following error:
未知速记标志:'a' in -aq)
我在标准(高级)命令提示符下运行 Windows 10 版本 10.0.17134.407.
I'm running Windows 10 Version 10.0.17134.407 in a standard (elevated) command prompt.
任何人都可以对此有所了解吗?
Can anyone shed any insight into this?
谢谢.
推荐答案
在你的 Windows shell 中,你可以:
In your Windows shell, you can do:
FOR /f "tokens=*" %i IN ('docker ps -q') DO docker stop %i
取自其他问题:在 Windows 上立即停止所有 docker 容器
这篇关于Docker 未知速记标志:-aq 中的“a")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!