devopsacademyau/2020-jun-project1-externals

ECR Repository

Opened this issue · 4 comments

Objectives:

  • Create a private ECR repository for hosting wordpress container image
  • The ECR Repository is not public

Acceptance Criteria:

  • The ECR Repository is not public
  • I can push a container to that Registry
  • I can pull images from ECR from EC2 instances ECS running on my VPC
  • The README contains the name of the repo and instructions to push/pull images from the repository

Documentation will be done in #15

Terraform code was added to create an ECR Repo. Also an iam policy and attachment to the role that the ECS task uses is added so that ECS can fetch the image from ECR.

Once we have the image "cooked" we could update the task to point to the ECR repo.

These are the temporary instructions to push an image:

aws ecr get-login --no-include-email --region ap-southeast-2

Copy and run the output of previous command. Once executed you should get a "Login Succeeded"

Get the repo URI:

aws ecr describe-repositories |grep repositoryUri

The use it to tag and push the built image, for example:

docker tag wordpress:latest 016454647794.dkr.ecr.ap-southeast-2.amazonaws.com/wordpress:latest
docker push  016454647794.dkr.ecr.ap-southeast-2.amazonaws.com/wordpress:latest

Hey @roperto, do you think this issue/story can be moved to "Done"? It'll be pending to add the ECR image as input for the ECS task, but I believe that should be covered by issue #9

BTW, thanks for reviewing and approving it.