#!/usr/bin/env bash

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 038504843107.dkr.ecr.us-west-2.amazonaws.com

export TAG="2.0.20210219.0"
docker pull "amazonlinux:$TAG"

docker tag "amazonlinux:$TAG" "038504843107.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:$TAG"
docker tag "amazonlinux:$TAG" "038504843107.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:2"

docker push "038504843107.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:$TAG"
docker push "038504843107.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:2"

