Skip to content

Instantly share code, notes, and snippets.

@SafeEval
Created August 25, 2023 23:52
Show Gist options
  • Save SafeEval/d05f6f1f2b04276c99f6b1cbb083f843 to your computer and use it in GitHub Desktop.
Save SafeEval/d05f6f1f2b04276c99f6b1cbb083f843 to your computer and use it in GitHub Desktop.
Docker login to ECR
# #!/bin/bash
# Tired of looking this up.
# Assumes a properly configured AWS CLI profile/credentials and AWS_REGION is set.
aws ecr get-login-password | docker login -u AWS --password-stdin "https://$(aws sts get-caller-identity --query 'Account' --output text).dkr.ecr.$AWS_REGION.amazonaws.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment