You want to use the Amazon Elastic Container Registry (ECR) with the native Bamboo Docker task.
We are going to use the official docker-library/hello-world image as an example:
(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.
docker --version |
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:
(Optional) Only specify a 'Registry ID' if your Amazon ECR repository is not hosted in your own AWS account.
Select the 'Source' to be either an IAM Role for EC2 (Agent) or an Identity Federation for AWS Connector.
We are only going to need the following variables later on:
${bamboo.custom.aws.ecr.proxyEndpointDomain} ${bamboo.custom.aws.ecr.username} ${bamboo.custom.aws.ecr.password} |
Build a Docker image on the Bamboo agent:
${bamboo.custom.aws.ecr.proxyEndpointDomain}/hello-world:latest.
(Optional) Run the hello-world image for demo/test purposes:
Specify the 'Docker image' as ${bamboo.custom.aws.ecr.proxyEndpointDomain}/hello-world:latest.
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. |
${bamboo.custom.aws.ecr.proxyEndpointDomain}/hello-world:latest.
${bamboo.custom.aws.ecr.username}.
${bamboo.custom.aws.ecr.password}.
E.g. 'none
' also works: 'Email' is a required field, but the address is ignored by Amazon ECR.
Specifying an email address is not supported anymore as of Bamboo 6.2.0, because the -e and --email flags flags have been removed from Docker engine as of release 17.06, see and Bamboo Docker task fails due to ProcessException: Error executing '/usr/bin/docker login ...', exit code: 125. |
Find below compatibility notes regarding this article (see also Identity Federation for AWS Compatibility Notes).
No known compatibility issue.
Bamboo < 5.14.4
|
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|