First Batch job fails with CannotPullContainerError

4

I am trying to walk through the simple "Submit your first Batch job" for AWS Batch. I go through all of the 5 steps, choosing Fargate as the platform, and leaving all items at default values, and finally submit the job. However, the job fails with this status reason:

CannotPullContainerError: inspect image has been retried 5 time(s): failed to resolve ref "docker.io/library/amazonlinux:latest": failed to do request: Head https://registry-1.docker.io/v2/library/amazonlinux/manifests/latest: dial tcp 34.237.244.67:44...

I am probably missing something very basic, but have no idea what. Thanks!

  • Update: If I change the platform to EC2 it seems to work. Any ideas why Fargate does not?

  • I received the same error on Fargate as well, following the same steps. +1 for this question.

質問済み 2年前1819ビュー
1回答
6
承認された回答

Hello! If using Fargate and the subnets associated with your Batch compute environment do not have a NAT Gateway attached, your job will fail as it cannot connect to the internet to pull the Docker image. To solve this issue, you can set the assignPublicIp parameter in the Batch job definition to be ENABLED. For more info on Fargate compute environments in Batch, check out this documentation.

profile pictureAWS
回答済み 2年前
  • Thanks very much. It would be worth adding this small detail to that tutorial.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ