Last active
July 9, 2019 17:44
-
-
Save y13i/d58b193d1ddaea01b134e18b2aa16169 to your computer and use it in GitHub Desktop.
AWS ECR にイメージを push する方法をいつも忘れるのでメモ
This file contains 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
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