Created
June 29, 2020 17:06
-
-
Save SlootSantos/9eb46c8b4febf54dc2220b568ae78f80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # login to ECR which sets a auth token to the ENV | |
| $(aws ecr get-login --no-include-email --region REGION) | |
| # build the container the way you always build it | |
| docker build -t REGISTRY/IMG_NAME:latest -f "${PWD}/Dockerfile" ${PWD} | |
| # get your latest image's ID | |
| IMAGE_ID=$(docker images -q REGISTRY/IMG_NAME:latest) | |
| ECR_URL=YOUR_ECR_URL | |
| # tag it | |
| docker tag $IMAGE_ID $ECR_URL:latest | |
| # push it | |
| docker push $ECR_URL:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment