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:
Create a 'hello-world' Amazon ECR repository via the AWS Management Console
Open the Amazon ECS console repositories page.
For 'Repository Name',
enter enter a unique name for your repository and choose 'Next step'.
You can skip the 'Build, tag, and push Docker image' step.
(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 language bash titledocker --version
(Optional) Configure a Source Code
Checkout task 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.
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 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 variables
Code Block language bash
${bamboo.custom.aws.ecr.proxyEndpointDomain} ${bamboo.custom.aws.ecr.username} ${bamboo.custom.aws.ecr.password}
Build a Docker image on the Bamboo agent:
Specify the 'Repository' as
${bamboo.custom.aws.ecr.proxyEndpointDomain}/hello-world:latest.
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.
(Optional) Run the hello-world image for demo/test purposes:
Specify the 'Docker image' as
${bamboo.custom.aws.ecr.proxyEndpointDomain}/hello-world:latest.
Tip title
Bamboo agents vs. Amazon ECS clusterIf 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.
Push the hello-world image to the Amazon ECR registry:
Select 'Custom registry' and specify the 'Repository' as
${bamboo.custom.aws.ecr.proxyEndpointDomain}/hello-world:latest.
Specify the 'Username' as
${bamboo.custom.aws.ecr.username}.
Specify the 'Password' as
${bamboo.custom.aws.ecr.password}.
The 'Password' field is masked, so copying a respectively prepared string from elsewhere ensures the correct syntax is being used.
(Deprecated) Specify an arbitrary email address when using Bamboo < 6.2.0.
E.g. '
none
' also works: 'Email' is a required field, but the address is ignored by Amazon ECR.
Note title
Removal of --email / -e flag as of Docker 17.06Specifying an email address is not supported anymore as of Bamboo 6.2.0, because
flags have been removed from Docker engine as of release 17.06, see
andJira Legacy server Atlassian JIRA columns key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution serverId 144880e9-a353-312f-9412-ed028e8166fa key BAM-18613
Compatibility notes
Find below compatibility notes regarding this article (see also Identity Federation for AWS Compatibility Notes).
...
Expand | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Bamboo < 5.14.4
|
Related articles
Filter by label (Content by label) | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Page Properties | ||
---|---|---|
| ||
|