Pushing docker image to ECS (Elastic Container Service)
In order to push to Amazon's ECS registry you need to setup and configure your account.
First of all you need to setup aws and docker.
Goto AWS console to create a repository and follow the instructions. If you needed a sample project, please clone one here.
To summarize, the steps, do the following. (i assume you created a repository called "jeremy".
Get a docker login command (setup your credential) by running the following command :-
aws ecr get-login --no-include-email --region ap-southeast-2
Then build your image
docker build -t dotnetapp-prod .
docker tag dotnetapp-prod
312611170176.dkr.ecr.ap-southeast-2.amazonaws.com/jeremy:dotnetapp-prod
And push your image to Amazon
docker push 312611170176.dkr.ecr.ap-southeast-2.amazonaws.com/jeremy:dotnetapp-prod
To browse your ECS repository, please go here.
Possible error message :-
Can't push image to Amazon ECR - fails with “no basic auth credentials”
- This means you didn't setup your aws credential - please set or export your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
Comments