docker.withServer("tcp://192.168.1.122:2375",'') {
def wait_results = sh(script: "docker exec -t development-taxpayer-server-131-1 echo aaa", returnStdout: true)
print wait_results
}
wait_results:无需打印
预期结果是在Jenkins控制台日志中打印'aaa'。
远程泊坞广告版本是:
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:23:59 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:23:59 2016
OS/Arch: linux/amd64
答案 0 :(得分:0)
尝试改为
def wait_results = sh(script: "docker ps -a", returnStdout: true)
这样你至少可以检查:
development-taxpayer-server-131-1
正在运行然后,考虑docker exec
syntax,请尝试-it
:
def wait_results = sh(script: "docker exec -it development-taxpayer-server-131-1 echo aaa", returnStdout: true)
注意:“How to run a command on an already existing docker container?”显示相同的回显没有任何选项:
docker exec development-taxpayer-server-131-1 echo aaa