Skip to content

Instantly share code, notes, and snippets.

@felipekm
Last active April 6, 2018 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipekm/a992277ae7db95fbb09e727f1b11b33c to your computer and use it in GitHub Desktop.
Save felipekm/a992277ae7db95fbb09e727f1b11b33c to your computer and use it in GitHub Desktop.
ECR - Build, tag, and push Docker image

1) Retrieves the docker login command that you can use to authenticate your Docker client to your registry

aws ecr get-login --no-include-email --region sa-east-1

1.1) Copy the response content docker login... and run it before next step

2) Build your Docker image using the following command

docker build -t pling-docker .

3) After the build completes, tag your image so you can push the image to this repository

docker tag <ECR_NAME>:<TAG> <ECR_ID>.dkr.ecr.<REGION>.amazonaws.com/<ECR_NAME>:<TAG>

4) Run the following command to push this image to your newly created AWS repository

docker push <ECR_ID>.dkr.ecr.<REGION>.amazonaws.com/<ECR_NAME>:<TAG>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment