Last active
August 24, 2020 21:19
-
-
Save adamabernathy/b17eb7545b580660c27b1d886868b7f1 to your computer and use it in GitHub Desktop.
Bash/Sh AWS ECR auth script
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/sh | |
# Generic AWS ECR authentication script | |
REGION=us-east-1 | |
ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account) | |
aws ecr get-login-password --region $REGION \ | |
| docker login \ | |
--username AWS \ | |
--password-stdin $ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment