Push docker image to amazon ecs repository

前端 未结 5 2288
春和景丽
春和景丽 2020-12-12 17:39

Im new to AWS. I want to set up a private docker repository on an AWS ECS container instance. I created a repository named name. The example push commands shown

5条回答
  •  悲哀的现实
    2020-12-12 18:17

    Addition to the above answer, I came across here today, as the login command change with aws-cli v2, posting as an answer might help others. as aws-cli v1 login command no longer work.

    V1
    $(aws ecr get-login --no-include-email)
    
    

    To push image to ECR using aws-cli v2 you need

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

    Then you are okay to build and push

    docker build -t myrepo .
    docker tag myrepo:latest 123456789.dkr.ecr.us-west-2.amazonaws.com/myrepo
    docker push 123456789.dkr.ecr.us-west-2.amazonaws.com/myrepot
    
    

    Typically One image per registry is a clean approach, that why AWS increase image per repository and repository per region from 1000 to 10,000.

提交回复
热议问题