Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need help with Bamboo using Docker for build/test environments

Hello everyone,

I having an issue with Bamboo using Docker to spin up a Python container install some packages then run unit tests.

I am using Bamboo YAML spec files for configuring the pipeline. In the Spec file I defined Docker to use the Python image at the plan level.

When the pipeline runs Bamboo spins up the Python container and runs the Build stage to install python packages, but for the Test stage Bamboo spins up another Python container that doesn't have my dependencies and tests fail.

I must be misunderstanding or doing something wrong. Any guidance or assistance would be much appreciated.



- Bamboo Spins up Python container

- pulls code

- install packages

- run tests

All inside the same isolated container.


Example Spec File:

version: 2
   project-key: AN
   key: PYAPP
   name: py app testing

   image: python:3.7
      ${}: ${}:z
      ${}: ${}:z
  use-default-volumes: false

  - Build environment:
       - Build
  - Test Ansible Role:
       - Test

   - script:
       - pip install pytest
       - pip install -e .

    - script:
        - pytest

1 answer

1 accepted

0 votes
Answer accepted

Hello @Patrick Peace

The behavior you see is expected. You defined two different stages, each stage has a different job. Each job will run in a fresh Docker container. 

To avoid the issue you are facing you could:

Option 1

  • Put all the tasks in the same stage.

Option 2

  • Build a new image with all the dependencies you need for your build and add it to docker hub. Then reference the new image in your build. This will allow you to use different jobs for your builds without the need to re-add the dependencies.

I hope that clarifies the issue.

You are always welcome @Patrick Peace!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

67 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you