In this module, we’re going to take our already containerized application and push this to Amazon Elastic Container Registry (ECR).
We will first deploy our CloudFormation template which provisions our ECR Repositories. But first, let’s make sure we are in the correct directory by running:
Next, let’s deploy the CloudFormation template using the AWS CLI tool by running the following command:
aws cloudformation create-stack \ --stack-name "atlassian-connect-ecr" \ --template-body file://ecr.yaml \ --parameters ParameterKey=ProjectName,ParameterValue=atlassian-connect \ --capabilities CAPABILITY_NAMED_IAM
Now, let’s wait for the template to finish deploying and monitor its status by running the following command:
until [[ `aws cloudformation describe-stacks --stack-name "atlassian-connect-ecr" --query "Stacks.[StackStatus]" --output text` == "CREATE_COMPLETE" ]]; do echo "The stack is NOT in a state of CREATE_COMPLETE at `date`"; sleep 30; done && echo "The Stack is built at `date` - Please proceed"