在隔离构建Docker容器中执行Bamboo脚本任务时出现以下错误:
simple 27-Jun-2019 Starting task 'XYZ' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
command 27-Jun-2019 Beginning to execute external process for build 'XYZ'\n ... running command line: \n/tmp/runInDocker3301468521768702357.sh /home/bamboo/bamboo-agent-home/temp/XYZ-8591248614821374698.sh\n ... in: /tmp\n
error 27-Jun-2019 flag provided but not defined: -e
error 27-Jun-2019 See 'docker exec --help'.
simple 27-Jun-2019 Failing task since return code of [/tmp/runInDocker3301468521768702357.sh /home/bamboo/bamboo-agent-home/temp/XYZ-8591248614821374698.sh] was 125 while expected 0
simple 27-Jun-2019 Finished task 'list buckets' with result: Failed
以下类似于此链接Docker Runner的配置,并在此处显示:
Isolate build -> Docker container -> Docker image: `ubuntu:16.04`
脚本任务是:
Shell -> Inline
具有以下简单内容:
echo "Hallo AWS"
#!/bin/bash
Bamboo版本为6.5.1
。
答案 0 :(得分:1)
面对相同/相似的问题。我开始我的竹计划
Isolate build -> Docker container -> Docker image: centos
我有一个内联脚本任务,该任务返回一些数据。
whoami
ls -la
pwd
输出不是来自容器,而是来自代理。我希望路径为/ home / bamboo,因为这是我直接在docker中运行映像时的起点。
19-Mar-2020 15:07:41 bamboo
19-Mar-2020 15:07:41 total 0
19-Mar-2020 15:07:41 drwxr-xr-x 2 bamboo bamboo 6 Mar 19 19:07 .
19-Mar-2020 15:07:41 drwxr-xr-x 3 root root 30 Mar 19 19:07 ..
19-Mar-2020 15:07:41 /home/bamboo/bamboo-agent-home/xml-data/build-dir/SANDY-JOB1
答案 1 :(得分:0)
如果尝试在Bamboo Docker Runner映像上设置环境变量(隔离构建,而不是使用代理环境),则有以下三种选择:
FROM microsoft/dotnet:sdk ENV foo=bar ENTRYPOINT ["dotnet", "myRuntime.dll"]