Skip to content

Instantly share code, notes, and snippets.

@adamabernathy
Last active August 24, 2020 21:19
Show Gist options
  • Save adamabernathy/b17eb7545b580660c27b1d886868b7f1 to your computer and use it in GitHub Desktop.
Save adamabernathy/b17eb7545b580660c27b1d886868b7f1 to your computer and use it in GitHub Desktop.
Bash/Sh AWS ECR auth script
#!/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