Dockerコンテナのビルド中にエラー(failed to solve with frontend dockerfile.v0)
以下の記事が参考になりました。
エラー内容
PowerShell
>> docker compose up -d --build
[+] Building 1.1s (6/10)
[+] Building 1.2s (10/10) FINISHED
=> [project_db internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 170B 0.0s
=> [project_web internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 542B 0.0s
=> [project_app internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.0s
=> [project_db internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [project_web internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [project_app internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> CANCELED [project_db internal] load metadata for docker.io/mysql/mysql-server:8.0 0.9s
=> ERROR [project_web internal] load metadata for docker.io/library/nginx:1.20-alpine 0.9s
=> CANCELED [project_web internal] load metadata for docker.io/library/node:16-alpine 0.9s
=> CANCELED [project_app internal] load metadata for docker.io/library/php:7.3-fpm-buster 0.9s
------
> [project_web internal] load metadata for docker.io/library/nginx:1.20-alpine:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: ``
解決策
コマンドをスーパーユーザ権限で実行することで、問題なくビルドできました。
PowerShell
sudo docker compose up -d --build