My EC2 instance can't authenticate using an IAM role. The instance shows the correct role in the AWS console: IAM role: Docker-WorkerRole-DPET4SO6HV87
. Clicking that opens up the Role console, where I can see the correct policy listed: 'ecr-pull-image'
. A click on that shows the following permissions:
{
"Version": "2008-10-17",
"Statement": [
{
"Action": [
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
The Trusted Entities tab shows:
The identity provider(s) autoscaling.amazonaws.com
The identity provider(s) ec2.amazonaws.com
It works in the simulator.
But when I when hop on that instance and try to pull an image I get no basic auth credentials:
$ docker pull 4----------7.dkr.ecr.us-west-2.amazonaws.com/gc01_data:1.0.0
Error response from daemon: Get https://4----------7.dkr.ecr.us-west-2.amazonaws.com/v2/gc01_data/manifests/1.0.0: no basic auth credentials
Or, after attempting docker stack deploy, my docker.log shows the same:
Aug 29 21:05:15 moby root: time="2017-08-29T21:05:15.434428743Z" level=debug msg="Trying to pull 4----------7.dkr.ecr.us-west-2.amazonaws.com/gc01_data from https://4----------7.dkr.ecr.us-west-2.amazonaws.com v2"
Aug 29 21:05:15 moby root: time="2017-08-29T21:05:15.449145816Z" level=info msg="Attempting next endpoint for pull after error: Get https://4----------7.dkr.ecr.us-west-2.amazonaws.com/v2/gc01_data/manifests/1.0.0: no basic auth credentials"
Can't see what's missing. Thanks.