• Community
  • Products
  • Bitbucket
  • Questions
  • Since Bitbucket uses git/mercurial for the code repo, does the docker image need to have those installed inside of it? Or is the checkout done outside the image and then mounted?

Since Bitbucket uses git/mercurial for the code repo, does the docker image need to have those installed inside of it? Or is the checkout done outside the image and then mounted?

This question is in reference to Atlassian Documentation: Use Docker images as build environments in Bitbucket Pipelines

Ask your question here...

2 answers

1 accepted

If you're talking about docker images used with Bitbucket Pipelines, then you don't necessarily need git or mercurial on the image. The code will be checked out using a separate image before your container is started.

Cool. So then since I do not need git or mercurial, what volume mount do I need for my image so the code can be mounted in it? What I a trying to do is run a command from within my container in the pipeline to generate the files and get those published over to my deployment server.

The directory containing your code is automatically mounted into your container using the -v option of the docker run command. You can't control where it gets mounted, but your pipeline script will be run from within the directory containing your code.

Got it. That helped a lot for me to setup the pipeline correctly. It works just fine now smile

Assuming that you mean a bamboo remote agent running inside a docker container - we've found that having git installed inside the container is more stable.  Find the bamboo remote agent image that Atlassian maintains for how to write your Dockerfile. Note that you need to define a capability for git so that Bamboo knows it's there.  You do this with a script they provide.  It would look something like this (we use CentOS as the base image):

 

RUN	yum install git
 
RUN /root/bamboo-update-capability.sh "system.git.executable" "/usr/bin/git"

No I do not mean a bamboo remote agent (unless you are saying that the Pipeline plugin uses bamboo)

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

660 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot