Run Custom Docker Image in Pipeline

We have created a custom Docker image and put in docher hub as public image.

In our repository yml file, image name is given with this detail as follows. 

========= yml file ==========

image: myxxxx/docker-xxxxx

    - step:
          - echo "This script runs on all branches that don't have any specific pipeline assigned in 'branches'."


My expectation is that default Atlassian docker image shouldnt run, instead, my custom docker image should be run first.

But when a push is done in repository or manually re run the yml file, the log/console in pipeline is produced as follows, where in default Atlassian docker image is run. My Question is "Can we run our custom Docker iamge at first, can we disable the default image run and default hg clone ?"

+ docker run -t --entrypoint=/bin/bash --memory=4096m -e BUILD_DIR=/opt/atlassian/pipelines/agent/build -v /tmp/ -v build-volume-c4610737-4c4c-43b9-a3a0-b87a7ca1f9fb:/opt/atlassian/pipelines:rw -w /opt/atlassian/pipelines/agent/build --label com.atlassian.pipelines.agent="a884e9948c81" "atlassian/pipelines-dvcstools:latest" -i /tmp/bashScript5134297271196295798.shWARNING: Your kernel does not support swap limit capabilities, memory limited without swap.+ umask 000Completed at 2016-12-23T05:20:00Z+

hg clone -r "bd45bf5364e548417b1a49b210075bca381b52b6" https://x-token-auth:$ .

adding changesetsadding manifestsadding file changesfiles

+ chmod 777 $BUILD_DIR+ docker pull

/* Docker image download logs*/

Status: Downloaded newer image for myxxxx/docker-xxxxx:latest+ docker run -t --rm=true --cidfile=/tmp/1482470399216-0/{4b8b7f78-4751-4700-b22e-e47061208add} --entrypoint=/bin/bash --memory=4096m --env-file=/tmp/dockerEnvironment9198828661972663903.env -v /tmp/ -v build-volume-c4610737-4c4c-43b9-a3a0-b87a7ca1f9fb:/opt/atlassian/pipelines:rw -v build-volume-c4610737-4c4c-43b9-a3a0-b87a7ca1f9fb:/opt/atlassian/bitbucketci:rw -w /opt/atlassian/pipelines/agent/build --label com.atlassian.pipelines.agent="a884e9948c81" "myxxxx/docker-xxxxx" -i /tmp/

WARNING: Your kernel does not support swap limit capabilities, memory limited without swap.


1 answer

1 accepted

1 vote
Answer accepted


There are two Atlassian Docker images:

  1. atlassian/default-image: This is used when no image field is provided. Your pipeline will run inside of this image.
  2. atlassian/pipelines-dvcstools: This is used to clone your repository from Bitbucket, so it will always be used during a build. We will then mount the repository contents into your defined image myxxxx/docker-xxxxx (or atlassian/default-image if you didn't define an image).

In short, atlassian/pipelines-dvcstools will always be involved in your pipeline at the moment so the repo contents can be cloned. However, your pipeline is still being run inside of the image you define.

In our case the image atlassian/pipelines-dvcstools starts cloning parent repository, but while cloning sub-repo of Bitbucket mercurial,  auth token is not able to clone sub repo and gets hung requesting for the password token. Is there a way to checkout mercurial subrepo

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

296 views 0 12
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