Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

You want to use the Amazon Elastic Container Registry (ECR) with the native Bamboo Docker task.


  1. Create a 'hello-world' Amazon ECR repository via the AWS Management Console

    1. Open the Amazon ECS console repositories page.

    2. For 'Repository Name', enter a unique name for your repository and choose 'Next step'.

    3. You can skip the 'Build, tag, and push Docker image' step.

  2. (Optional) Configure a Script task to check the Docker version in use by the Bamboo agent - Docker is evolving fast, so it is helpful to have this information readily available in the build log for debugging purposes.

    Report Docker version

    Code Block
    docker --version
  3. (Optional) Configure a Source Code Checkout task with the repository that contains your Dockerfile (can also be specified inline instead) - for this example we are going to checkout the official docker-library/hello-world image repository.

  4. Configure the Amazon ECR Credentials Variables task with an appropriate AWS credentials source, just like you would do for a dedicated task - this injects the resulting temporary Amazon ECR authentication credentials as Bamboo variables for reuse in subsequent tasks:

    1. (Optional) Only specify a 'Registry ID' if your Amazon ECR repository is not hosted in your own AWS account.

    2. Select the 'Source' to be either an IAM Role for EC2 (Agent) or an Identity Federation for AWS Connector.

    3. We are only going to need the following variables later on:

      Bamboo variables

      Code Block
  5. Build a Docker image on the Bamboo agent:

    1. Specify the 'Repository' as ${}/hello-world:latest.

    2. Select 'Use an existing Dockerfile located in the task's working directory' to work with the docker-library/hello-world image source checked out in step 2 above.

  6. (Optional) Run the hello-world image for demo/test purposes:

    1. Specify the 'Docker image' as ${}/hello-world:latest.

      (tick) Bamboo agents vs. Amazon ECS cluster

      If your goal is to use the Bamboo Docker task's Run action, you might want to consider running your container on the Amazon Elastic Container Service (ECS) instead, which, other than running containers on Bamboo agents, is a highly scalable, high performance container management service that allows you to easily run applications on a managed cluster of Amazon EC2 instances - refer to Deploying to Amazon ECS for details.

  7. Push the hello-world image to the Amazon ECR registry:

    1. Select 'Custom registry' and specify the 'Repository' as ${}/hello-world:latest.

    2. Specify the 'Username' as ${}.

    3. Specify the 'Password' as ${}.

      • (lightbulb) The 'Password' field is masked, so copying a respectively prepared string from elsewhere ensures the correct syntax is being used.

    4. (Deprecated) Specify an arbitrary email address when using Bamboo < 6.2.0.



Bamboo < 5.14.4


Bamboo variable substitution in repository specification

There seems to be an issue with the built-in Bamboo Docker tasks' field validation for custom Docker registry endpoints, which does not fully support the advertised 'registry.address:port/namespace/repository:tag' format when using Bamboo variables apparently (refer to

Jira Legacy
serverAtlassian JIRA
for details):

  • (tick) Variables are supported for registry and tag fragments (e.g. ${}/namespace/repository:${bamboo.buildResultKey}).

  • (error) Variables are not supported for namespace and repository fragments (e.g. ${}/${bamboo.namespaceName}/${bamboo.repositoryName}:latest).

Filter by label (Content by label)
cqllabel in ( "docker" , "amazon-ecr" , "bamboo" , "task" , "variables" , "amazon-ecs" ) and type = "page" and space in ( "UAAKB" , "TAWS" )
labelsbamboo docker amazon-ecs amazon-ecr variables task
Page Properties

Related issues