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.

feita há 2 anos1894 visualizações
1 Resposta
6
Resposta aceita

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
respondido há 2 anos
profile picture
ESPECIALISTA
avaliado há 25 dias
  • Thanks very much. It would be worth adding this small detail to that tutorial.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas

Conteúdo relevante