Last active
July 23, 2020 06:48
-
-
Save devfire/0ce1229292f2b6aa9a81ced818cd78b6 to your computer and use it in GitHub Desktop.
aws ecr login
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
#!/bin/bash | |
set -e | |
REPO_NAME=$1 | |
ECR_URL=31415926.dkr.ecr.us-east-1.amazonaws.com | |
if [ $# -ne 1 ]; then | |
echo $0: usage: $0 REPO_NAME | |
exit 1 | |
fi | |
eval $(aws ecr get-login --region us-east-1 --no-include-email | sed 's|https://||') | |
docker build -t "$REPO_NAME" . | |
docker tag "$REPO_NAME":latest "$ECR_URL"/"$REPO_NAME":latest | |
docker push "$ECR_URL"/"$REPO_NAME":latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider using this shortcut instead of eval
aws ecr get-login --region us-east-1 --no-include-email | bash