buildx: Failed to solve with frontend dockerfile.v0: failed to create LLB definition

It was all working fine till yesterday until I saw this. And even till today, I am unable to fix this.

Environment:

Windows 10. Docker version 20.10.7, build f0df350

Error Details:


[+] Building 9.6s (4/4) FINISHED
 => [internal] load build definition from Dockerfile                                                                       0.5s 
 => => transferring dockerfile: 32B                                                                                        0.0s 
 => [internal] load .dockerignore                                                                                          0.8s 
 => => transferring context: 2B                                                                                            0.0s 
 => ERROR [internal] load metadata for public.ecr.aws/lambda/python:3.8                                                    8.5s 
 => [auth] aws:: lambda/python:pull token for public.ecr.aws                                                               0.0s 
------
 > [internal] load metadata for public.ecr.aws/lambda/python:3.8:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code [manifests 3.8]: 403 Forbidden
The terminal process "C:\Windows\System32\cmd.exe /d /c docker build --pull --rm -f "Dockerfile" -t idealoctopotato:latest "."" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.```

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (1 by maintainers)

Most upvoted comments

On M1 Mac I notice at times I have to just restart Docker desktop and the error clears. ¯_(ツ)_/¯

If you use the docker desktop on Mac OS/Windows, You can try to disable buildkit in the docker engine JSON configuration:

{
  ...
  "features": {
    "buildkit": false
  }, 
  ...
}

That works for me. I am using Docker [4.6.1] desktop version for Mac M1 chips

@Mozart409 I changed the repository to amazon/aws-lambda-python:3.8 and it started working.

Or before docker-compose build, run the following commands to inenable buildkit.

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

You might have to be authenticated to access public.ecr.aws

I ran this command and it worked for me

aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws

Doc : https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth

You might also have an old token cached that prevent anonymous pulls

An unauthenticated pull is a pull without an auth token. You can confirm whether there is an auth token in your Docker configuration by checking your ~/.docker/config.json file. If you’ve previously authenticated to Amazon ECR Public but you want to perform an unauthenticated pull, you can logout using the docker logout public.ecr.aws command which will remove the auth token from your Docker configuration file.

If you’re using WSL, maybe the problem is the docker-desktop credential; try to delete "credsStore": "desktop.exe" in ~/.docker/config.json

Manually pulling those worked.

In my case:

docker pull python:3.10.9-slim 
docker pull alpine/git:2.36.2

You might have to be authenticated to access public.ecr.aws

I ran this command and it worked for me

aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws

Doc : https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth

You might also have an old token cached that prevent anonymous pulls

An unauthenticated pull is a pull without an auth token. You can confirm whether there is an auth token in your Docker configuration by checking your ~/.docker/config.json file. If you’ve previously authenticated to Amazon ECR Public but you want to perform an unauthenticated pull, you can logout using the docker logout public.ecr.aws command which will remove the auth token from your Docker configuration file.

This is the only fix working for me.

On M1 Mac I notice at times I have to just restart Docker desktop and the error clears. ¯\(ツ)

I can confirm the same solution works on Linux too: sudo systemctl restart docker

On M1 Mac I notice at times I have to just restart Docker desktop and the error clears. ¯_(ツ)_/¯

@aflansburg, same here! Restart helps…

same problem again. I change image with written before, it works!

On M1 Mac I notice at times I have to just restart Docker desktop and the error clears. ¯_(ツ)_/¯

Happens on M2 Mac as well. Restarting the Docker daemon seems to resolve it.

For me this issue occured with different images from different repos. So far it always worked to manually pull the image with docker pull and afterwards build the image from the Dockerfile.

@Mozart409 I changed the repository to amazon/aws-lambda-python:3.8 and it started working.

Thanks. Worked as well with me.

@Mozart409 I changed the repository to amazon/aws-lambda-python:3.8 and it started working.

I will try that. Thank you 😄