【发布时间】:2017-01-31 12:13:28
【问题描述】:
我正在尝试使用 linux shell 和 Docker 在 VSTS 上运行以下嵌套命令,因此我可以停止并删除所有基于“jspsample”映像的容器:
docker rm $(docker stop $(docker ps -a -q --filter ancestor=jspsample --format="{{.ID}}"))
不幸的是,代理总是返回以下错误代码:
2017-01-31T12:06:22.0585100Z unknown shorthand flag: 'a' in -a
2017-01-31T12:06:22.0636870Z See 'docker stop --help'.
2017-01-31T12:06:22.0827520Z ##[error]/usr/bin/docker failed with return code: 125
2017-01-31T12:06:22.0850140Z ##[error]/usr/bin/docker failed with error: /usr/bin/docker failed with return code: 125
有没有办法运行这个嵌套命令,还是我需要运行一个 shell 脚本?
【问题讨论】:
-
如果您在构建代理机器上手动运行该嵌套命令会产生什么结果?
标签: docker tfs azure-devops