Automatically login on Amazon ECR with Docker Swarm

We have Docker images hosted on Amazon ECR and the goal is to run them on EC2 instances using Docker Swarm. The services are configured in global mode so that they are automatically replicated on new nodes. An auto-scaling group can automatically add new EC2 instances to the swarm.

The problem is that Docker can not pull the images from the ECR registry. Is there a way to tell Docker swarm to run aws ecr get-login prior to pulling images or is there a way to be permanently signed in into ECR while still using the IAM Role for authentication to ECR ?

Running aws ecr get-login at startup of the new nodes doesn't work either.

FYI: I'm not looking for --with-registry-auth, this works great when I manually update the service but not when AWS automatically adds new nodes.

0
задан 24 January 2018 в 20:39
2 ответа

Docker Swarm- ის და AWS ავტომატური მასშტაბის გამოყენებისას იგივე პრობლემა მქონდა.

გამოსავალი: შემდეგი სერვისის შესახებ პერიოდულად უნდა აწარმოოთ შემდეგი ბრძანება.

docker service update -d -q --with-registry-auth service-name

გაშვება aws ecr-get შესვლა კვანძის გაშვების დროს არ იმუშავებს.

ამ ბლოგ-პოსტში აღწერილია ეს საკითხი და მოცემულია სრული გადაწყვეტა, თუ როგორ უნდა განხორციელდეს ავტომატური შესვლა ECR– ში.

http://issamben.com/docker-swarm-ecr-auto-login/

0
ответ дан 5 December 2019 в 06:42

Для тех, кто все еще ищет решение, следуйте этой статье. Это более стабильное решение. https://medium.com/@MahmoudGaballah/ecr-for-docker-swarm-fdea3a9b01b1

0
ответ дан 21 August 2020 в 09:14

Теги

Похожие вопросы