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.

demandé il y a 2 ans1890 vues
1 réponse
6
Réponse acceptée

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
répondu il y a 2 ans
profile picture
EXPERT
vérifié il y a 24 jours
  • Thanks very much. It would be worth adding this small detail to that tutorial.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions