如何使用 AWS Deep Learning docker 容器



我正在学习 Coursera 课程:AWS 计算机视觉:GluonCV 入门

在本课程中,有一个视频,教师使用 docker 容器。 这是一个旧视频,但我认为图像仍然存在。 如果没有,我不知道如何搜索更新。该视频展示了如何创建用户账户,授予其使用 AWS docker 注册表的权限,以及如何登录然后使用该账户。 我已经完成了这一部分。

在课堂视频中,他们还演示了如何创建 EC2 实例,然后从 EC2 实例发出命令。 也许这是我的问题,但我不确定。 我正在尝试在本地计算机上使用码头工人。 由于我们正在创建一个用户 ID,因此似乎就是这种情况。 只要您的用户 ID 具有权限,那么它就应该可以工作。

以下是我正在尝试的命令:

$ aws configure

这行得通。 我为它提供我在 IAM 中创建的具有 AmazonEC2ContainerRegistryFullAccess 权限的用户账户信息。

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

这行得通。 输出的最后一行显示登录成功。 我不知道讲师从哪里获得注册表 ID,763104351884。 讲师只需提供号码。 我对 AWS 上的 docker 了解不多,所以我不确定是否有一种搜索可用注册表的方法。 如果是这样,这可能是一个问题。

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

此命令失败。 这是输出:

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'.

您可以在此处找到映像和存储库信息。

让我们看看你的命令:

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

我们可以看到这是从区域eu-west-1中提取图像。

登录时,您使用了:

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

因此,您已登录到区域us-west-1,但尝试从eu-west-1中提取图像。

这似乎是导致您问题的最可能原因。

请参阅: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.

最新更新