Skip to content

Instantly share code, notes, and snippets.

@y13i
Last active July 9, 2019 17:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y13i/d58b193d1ddaea01b134e18b2aa16169 to your computer and use it in GitHub Desktop.
Save y13i/d58b193d1ddaea01b134e18b2aa16169 to your computer and use it in GitHub Desktop.
AWS ECR にイメージを push する方法をいつも忘れるのでメモ
export AWS_ACCOUNT_ID=nnnn
export AWS_REGION=xxxx
export CONTAINER_REPOSITORY=xxxx
export CONTAINER_IMAGE_TAG=0.0.x
# Docker login to ECR
$(aws ecr get-login --no-include-email) # bash, zsh
# eval (aws ecr get-login --no-include-email) # fish
# build, tag, and push docker image
docker build -t "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$CONTAINER_REPOSITORY:$CONTAINER_IMAGE_TAG"
docker push "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$CONTAINER_REPOSITORY:$CONTAINER_IMAGE_TAG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment