AWS ECR Notes.md 938 B

AWS ECR Notes

How to upload a docker image from laptop to AWS ECR.

(skip) already included in docker? brew install docker-credential-helper-ecr

Add to ~/.docker/config.json ( or don't and maybe docker will add it for you. )

{
        "auths": {
                "701290387780.dkr.ecr.us-gov-east-1.amazonaws.com": {}
        },
        "credsStore": "osxkeychain"
}

Tag image you want to push up. In this example we are tagging the registry.access.redhat.com/rhel7 image for pushing up to AWS. Stores the creds in OSX Keychain

aws --profile mdr-common-services-gov ecr get-login-password | docker login --username AWS --password-stdin 701290387780.dkr.ecr.us-gov-east-1.amazonaws.com

docker image ls

docker tag registry.access.redhat.com/rhel7:latest 701290387780.dkr.ecr.us-gov-east-1.amazonaws.com/codebuild-rhel7:latest

docker push 701290387780.dkr.ecr.us-gov-east-1.amazonaws.com/codebuild-rhel7:latest