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
的输出(即<$ c $)停止所有容器时c> 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:
未知速记标志:-aq中的'a')
编辑:我正在标准(提升的)命令提示符下运行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屋!