Skip to content

Instantly share code, notes, and snippets.

@SlootSantos
Created June 29, 2020 17:06
Show Gist options
  • Select an option

  • Save SlootSantos/9eb46c8b4febf54dc2220b568ae78f80 to your computer and use it in GitHub Desktop.

Select an option

Save SlootSantos/9eb46c8b4febf54dc2220b568ae78f80 to your computer and use it in GitHub Desktop.
# login to ECR which sets a auth token to the ENV
$(aws ecr get-login --no-include-email --region REGION)
# build the container the way you always build it
docker build -t REGISTRY/IMG_NAME:latest -f "${PWD}/Dockerfile" ${PWD}
# get your latest image's ID
IMAGE_ID=$(docker images -q REGISTRY/IMG_NAME:latest)
ECR_URL=YOUR_ECR_URL
# tag it
docker tag $IMAGE_ID $ECR_URL:latest
# push it
docker push $ECR_URL:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment