gpt4 book ai didi

docker - VSTS/TFS中的命令嵌套

转载 作者:行者123 更新时间:2023-12-02 21:23:56 27 4
gpt4 key购买 nike

我正在尝试使用Linux Shell和Docker在VSTS上运行以下嵌套命令,因此我可以停止和删除所有基于“jspsample”图像的容器:

docker rm $(docker stop $(docker ps -a -q --filter ancestor=jspsample --format="{{.ID}}"))

enter image description here

不幸的是,代理总是返回以下错误代码:
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脚本?

最佳答案

“命令行”任务不支持命令嵌套。将命令另存为Shell脚本,然后上传到代码存储库,然后使用“Shell Script”任务运行脚本。

关于docker - VSTS/TFS中的命令嵌套,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41957314/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com