LoginSignup
2
0

More than 1 year has passed since last update.

【Docker】failed to solve: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount219234493/Dockerfile: no such file or directoryの対処法

Last updated at Posted at 2022-03-30

Railsのimageをpullするために、docker-compose runを実行したときに下記のエラーが発生しました。 手順は下記のクイックスタートと同様

翻訳すると、「フロントエンドdockerfile.v0で解決に失敗しました:dockerfileの読み取りに失敗しました:/ var / lib / docker / tmp / buildkit-mount219234493 / Dockerfileを開きます:そのようなファイルまたはディレクトリはありません」
ファイルがないって言われていますね。

error
docker-compose run web rails new . --force --database=postgresql
[+] Running 14/14
 - db Pulled                                                                                                      14.0s
   - c229119241af Pull complete                                                                                    3.0s
   - 3ff4ca332580 Pull complete                                                                                    3.2s
   - 5037f3c12de6 Pull complete                                                                                    3.2s
   - 0444ef779945 Pull complete                                                                                    3.3s
   - 47098a4166e7 Pull complete                                                                                    3.6s
   - 203cca980fab Pull complete                                                                                    3.7s
   - a479b6c0e001 Pull complete                                                                                    3.8s
   - 1eaa9abe8ca4 Pull complete                                                                                    3.8s
   - cad613328fe3 Pull complete                                                                                    9.5s
   - 1ce5087aacfa Pull complete                                                                                    9.5s
   - b133d2355caa Pull complete                                                                                    9.5s
   - b2694eb85faf Pull complete                                                                                    9.6s
   - 503b75e1e236 Pull complete                                                                                    9.6s
[+] Running 2/2
 - Network dockerapp_default  Created                                                                              0.6s
 - Container dockerapp-db-1   Created                                                                              0.7s
[+] Running 1/1
 - Container dockerapp-db-1  Started                                                                               1.0s
[+] Building 0.0s (1/2)
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 2B                                                                                 0.0s
failed to solve: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount219234493/Dockerfile: no such file or directory

ファイルはこんな感じです。

image.png

解決方法

ファイル名を「DockerFile」から「Dockerfile」という名前に変更したら、解決しました。 Dockerfileの名前で指定されているようです。

image.png

-f オプションで明示的に Dockerfile を指定しても解決するようです

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0