Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Running within a Docker container

Hi all,

I've created a docker image with the Windows runner:

This makes it easier to start a build farm, and makes it easier to reproduce the build environment. Ideally I would have liked to use NanoServer for a minimal image, but I found it difficult to install Git from command line so I used Chocolatey which is based on WindowsServerCore. I stuck with Chocolatey because it makes it convenient to install more SDKs onto the image.

I'd love it if this could be offered directly by Atlassian.




Kudos! This might just be what I need for my builds. I will have a look at it more closely later.

It seems to work but a few remarks:

  • It does download a fixed version worker, not latest version. I think you can do this easily by dropping the version number from the URL
  • Your image can be leaner by installing choco-cleaner and concatenate it to the install line of the chocolately packages using `; choco-clean`, e.g.:
    RUN choco install -y \
    git.install \
    openjdk \
    ; choco-cleaner

I took the liberty of using your start.ps1 powershells script and incorporate it into a .NET Framework 4.6.1 microsoft based image using Dockerfile with below content:


# Install Chocolatey
ADD install-choco.ps1 install-choco.ps1
RUN powershell c:\install-choco.ps1

# Install git and openjdk and choco-cleaner to minimize docker container layer(s)
RUN choco install -y \
choco-cleaner \
; choco-cleaner

RUN choco install -y \
git.install \
openjdk \
; choco-cleaner

RUN powershell -Command Expand-Archive C:\bitbucket-pipelines-runner

#WORKDIR C:\bitbucket-pipelines-runner\bin
WORKDIR C:/bitbucket-pipelines-runner/bin

# Install start script modified to inculde environment variabeles
ADD start.ps1 start.ps1

RUN git config --system core.longpaths true

ENTRYPOINT ["powershell", "./start.ps1"]

Like Ocky Saktya likes this

Newbie here, is there any example on how to use this runner in Bitbucket Pipeline?


Log in or Sign up to comment

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