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 年前1863 查看次数
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 年前
profile picture
专家
已审核 15 天前
  • Thanks very much. It would be worth adding this small detail to that tutorial.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则