Guest User

Untitled

a guest
Jul 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. IMAGE_NAME=sagemaker-byoc-tf-serving
  4. REGION=$(aws configure get region)
  5. ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
  6.  
  7. # If the ECS repository doesn't exist, creates it.
  8. aws ecr create-repository --repository-name ${IMAGE_NAME} > /dev/null 2>&1
  9.  
  10. # ECR requires the image name to be in this format:
  11. REPOSITORY_NAME=${ACCOUNT}.dkr.ecr.${REGION}.amazonaws.com/${IMAGE_NAME}:latest
  12.  
  13. # Tags the image with the expect ECR format
  14. docker tag ${IMAGE_NAME} ${REPOSITORY_NAME}
  15.  
  16. # Allows docker access to ECR
  17. $(aws ecr get-login --no-include-email)
  18.  
  19. # pushes the image to ECR
  20. docker push ${REPOSITORY_NAME}
Add Comment
Please, Sign In to add comment