Its time to throw our image at our ECS cluster. Thankfully, we’ve got a pipeline that builds an image for us, we just need to tell ECS where to look. Bundle our app into a Docker Container
The public TF registry has a module that we’ll use to build a private repository, we also need to note that our repository needs valid credentials to access our Docker Image. Whether our images live in DockerHub or GitHub.
There are a couple of ways we can store these credentials if we do choose to host our images with an external service -
We want to scaffold a private repository that we can push images to which means there are some practices that we’ll have to understand. For example, specifically when working with ECR, the tag you use maps your image to your ECR repository. The docker push
format looks like ECR_REGISTRY/ECR_REPOSITORY:IMAGE_TAG
. Your specific push command can be retrieved from the ECR console but other things to note can be found here - https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_concepts
We also want to upload our Docker images to ECR after its built. So let’s update our pipeline.