In the previous post we saw how to deploy a simple Selenium crawler on ECS. However, the Docker image for the crawler was stored in a Docker Hub repository. Now we’re going to see how to use the AWS Elastic Container Registry (ECR) instead.
- Go to the ECR Dashboard.
- Press the button.
- Select either Private or Public visibility.
- Choose a suitable name for the repository.
- Press the button.
- The newly created repository will appear in the list of repositories. Click the link for the repository.
- Press the button.
- Follow these instructions to build, tag and push your image.
- When you’ve pushed your image it will appear in the list of images in the repository.
- You can copy the image URI and use this to update the ECS task.
If you get an `AccessDeniedException` error from the `aws ecr get-login-password` then you might need to use the `--profile` option to specify the name of an AWS profile (specified in `~/.aws/credentials`) which has sufficient privileges.