Skip to content

Docker stack deploy does not pull images from AWS ECR: SOLVED

Issue

docker stack deploy does not pull images from AWS ECR (private registry)

Reason

Docker in swarm mode using credentials from swarm managers for deploy command

Steps

Add credentials AWS ECR for docker login to the swarm manager nodes, NOT to the worker nodes

$(aws ecr get-login --registry-ids {YOUR_ECR_IR} --no-include-email --region {YOUR_REGION})

Use command for deploy

docker stack deploy -c {DOCKER-COMPOSE.yml} --with-registry-auth {STACK_NAME}