netskink
netskink

Reputation: 4539

How to use AWS Deep Learning docker container

I'm taking the Coursera class: AWS Computer Vision: Getting Started with GluonCV

In this class, there is a video where the instructor uses a docker container. Its an old video, but I assume the images are still present. If not, I don't know how to search for updates. The video shows how to create a user account, give it permissions for using the AWS docker registry and how to login and then use the account. I've done that part.

In the class video they also demo how to create an EC2 instance and then from the EC2 instance they issue commands. Perhaps that is my problem, but I'm not sure. I'm trying to use the docker on my local computer. Since we are creating a user ID, it seems that this would be the case. As long as your userid has permissions then it should work.

Here are the commands I'm trying:

$ aws configure

This works. I give it the user account info I created in IAM with the AmazonEC2ContainerRegistryFullAccess permissions.

$(aws ecr get-login --region us-west-1 --no-include-email --registry-ids 763104351884)

This works. The last line of output says login succeeded. I don't know where the instructor gets the registry id, 763104351884. The instructor simply provides the number. I don't know much about dockers on AWS so I am not sure if there is a method for searching available registries. If so that might be a problem.

$ docker run -it 763104351884.dkr.ecr.eu-west-1.amazonaws.com/mxnet-training:1.4.1-cpu-py36-ubuntu16.04

This command fails. Here is the output:

Unable to find image '763104351884.dkr.ecr.eu-west-1.amazonaws.com/mxnet-training:1.4.1-cpu-py36-ubuntu16.04' locally
docker: Error response from daemon: Get https://763104351884.dkr.ecr.eu-west-1.amazonaws.com/v2/mxnet-training/manifests/1.4.1-cpu-py36-ubuntu16.04: no basic auth credentials.
See 'docker run --help'.

Upvotes: 2

Views: 404

Answers (1)

Chase
Chase

Reputation: 3116

You can find the images and repository info here.

Let's look at your command:

$ docker run -it 763104351884.dkr.ecr.eu-west-1.amazonaws.com/mxnet-training:1.4.1-cpu-py36-ubuntu16.04

We can see this is pulling an image from the region eu-west-1.

When you logged in, you used:

$(aws ecr get-login --region us-west-1 --no-include-email --registry-ids 763104351884)

So you have logged in to region us-west-1 but attempted to pull an image from eu-west-1.

This looks like the most likely cause of your problem.

See: https://docs.aws.amazon.com/AmazonECR/latest/userguide/common-errors-docker.html#error-403

You have authenticated to a different region

Authentication requests are tied to specific regions, and
cannot be used across regions. For example, if you obtain an
authorization token from US West (Oregon), you cannot use it
to authenticate against your repositories in US East (N.
Virginia). To resolve the issue, ensure that you have
retrieved an authentication token from the same Region your
repository exists in.

Upvotes: 4

Related Questions