Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
  • 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?

Sameet Nasnodkar September 13, 2016

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

1 vote
Answer accepted
Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2016

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.

Sameet Nasnodkar September 13, 2016

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.

Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2016

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.

Sameet Nasnodkar September 14, 2016

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

0 votes
Rich Duncan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 13, 2016

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"
Sameet Nasnodkar September 13, 2016

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 Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events