0
votes

I am using Bamboo for build and run docker image. And success fully create docker container but, by using Bamboo 'docker run task' not able run successfully but can not access the app (Python Falsk web app).

But, As a script task(In Bamboo) by using below command successfully execute the same.

docker run -d -p 8080:8080 Plan:latest

Please see below log

command 29-Aug-2019 10:59:41 Beginning to execute external process for build 'Project_Name - Plan - Default Job #87 (PLAN-DAS-JOB1-87)'\n ... running command line: \n/usr/local/bin/docker run --detach --name Plan -p 8080:8080 Plan:latest docker run -d -p 8080:8080 Plan:latest\n ... in: /Users/vineesh/bamboo/xml-data/build-dir/PLAN-DAS-JOB1\n ... using extra environment variables:

build   29-Aug-2019 10:59:41    64c8b5b096c8805746d86bc1ead3bdc954a4c29d3987449aef5fe56ff6aea202
simple  29-Aug-2019 10:59:41    Finished task 'Run appcontainer' with result: Success
simple  29-Aug-2019 10:59:41    Running post build plugin 'NCover Results Collector'
simple  29-Aug-2019 10:59:41    Running post build plugin 'Artifact Copier'
simple  29-Aug-2019 10:59:41    Running post build plugin 'npm Cache Cleanup'
simple  29-Aug-2019 10:59:41    Running post build plugin 'Clover Results Collector'
simple  29-Aug-2019 10:59:41    Running post build plugin 'Docker Container Cleanup'
command 29-Aug-2019 10:59:41    Beginning to execute external process for build 'Project_Name - Plan - Default Job #87 (PLAN-DAS-JOB1-87)'\n ... running command line: \n/usr/local/bin/docker rm -f Plan\n ... in: /Users/vineesh/bamboo/xml-data/build-dir/PLAN-DAS-JOB1\n
build   29-Aug-2019 10:59:42    Plan
simple  29-Aug-2019 10:59:42    Finalising the build...
simple  29-Aug-2019 10:59:42    Stopping timer.
simple  29-Aug-2019 10:59:42    Build PLAN-DAS-JOB1-87 completed.
simple  29-Aug-2019 10:59:42    Running on server: post build plugin 'NCover Results Collector'
simple  29-Aug-2019 10:59:42    Running on server: post build plugin 'Build Hanging Detection Configuration'
simple  29-Aug-2019 10:59:42    Running on server: post build plugin 'Clover Delta Calculator'
simple  29-Aug-2019 10:59:42    Running on server: post build plugin 'Maven Dependencies Postprocessor'
simple  29-Aug-2019 10:59:42    All post build plugins have finished
simple  29-Aug-2019 10:59:42    Generating build results summary...
simple  29-Aug-2019 10:59:42    Saving build results to disk...
simple  29-Aug-2019 10:59:42    Logging substituted variables...
simple  29-Aug-2019 10:59:42    Indexing build results...
simple  29-Aug-2019 10:59:42    Finished building PLAN-DAS-JOB1-87.

Also, not able to view the docker container by uising, docker ps -a commad. How can I solve this issue.

1

1 Answers

0
votes

A few things are going on here:

  • The Bamboo Docker task runner will remove your container after the plan finishes building. That is why you are unable to see the container.
  • You are running the container in detached mode (-d flag) which means you won't have logs for that container output to the console. While this is needed to move onto the next task it makes debugging difficult.
  • Bamboo is not detecting any errors and is saying that the container is running without error.

Based on your output it looks like Bamboo is running the container, and then immediately killing it when the plan finishes executing.

To debug you can try the following:

Run the container without the -d flag. This will most likely require you to stop the build manually, but at least it will allow you to remote into Bamboo, check the logs on the container, and verify that you can manually reproduce the steps you are attempting to automate.