Skip to content

Instantly share code, notes, and snippets.

@ResidentMario
Last active January 18, 2019 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ResidentMario/ecd4359b6cd4e6e936a57be12ed41a10 to your computer and use it in GitHub Desktop.
Save ResidentMario/ecd4359b6cd4e6e936a57be12ed41a10 to your computer and use it in GitHub Desktop.
# construct the ECR name.
account=$(aws sts get-caller-identity --query Account --output text)
region=$(aws configure get region)
fullname="${account}.dkr.ecr.${region}.amazonaws.com/quiltdata/sagemaker-demo:latest"
# create the repository in ECR.
aws ecr create-repository --repository-name "quiltdata/sagemaker-demo" > /dev/null
# Get the login command from ECR and execute it directly
$(aws ecr get-login --region ${region} --no-include-email)
# Build the docker image, tag it with the full name, and push it to ECR
docker build -t "quiltdata/sagemaker-demo" quilt-sagemaker-demo/
docker tag "quiltdata/sagemaker-demo" ${fullname}
docker push ${fullname}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment