docker build with WSL2 - failed to create LLB definition: unexpected status code 403 Forbidden

Viewed 3098

Windows 10 Version: 10.0.18362.1256
Docker Desktop Version: 3.6.0(the latest until 2021/8/25)

Dockerfile from https://github.com/docker/getting-started.

Command: docker build -t getting-started .

Logs:

niaomingjian@DESKTOP-DQO:~/docker/getting-started$ docker build -t getting-started .
[+] Building 0.2s (5/5) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 1.05kB                                                                             0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 52B                                                                                   0.0s
 => CANCELED [internal] load metadata for docker.io/library/nginx:alpine                                           0.1s
 => CANCELED [internal] load metadata for docker.io/library/python:alpine                                          0.1s
 => ERROR [internal] load metadata for docker.io/library/node:12-alpine                                            0.1s
------
 > [internal] load metadata for docker.io/library/node:12-alpine:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code [manifests 12-alpine]: 403 Forbidden

Command docker pull node:12-alpine succeeded.

Pulling nginx:alpine, python:alpine, node:12-alpine respectively can work.
But the pulling process could't work in the building process.

1 Answers

Based Jeff Gruenbaum's comment:

Are you using gcr? 403 Forbidden means you don't have permission to pull.

Try (You must using gcloud if pull from gcr, right?):

  1. gcloud config configurations list then you see list of your gcp account

  2. switch your account to account that have pull permission by gcloud config configurations activate YOUR_ACCOUNT.

Related