LoginSignup
8
4

More than 1 year has passed since last update.

簡単なDockerファイルを作成したがビルドに失敗する

Last updated at Posted at 2022-01-19

概要

  • 超絶簡単なDockerファイルを作成したがビルド時にエラーが出たので問題箇所をまとめる

やったこと

  • 下記のDockerファイルを作成した

    • ファイル名: DockerFile
    • 内容

      FROM centos:7
      RUN yum update -y
      
  • 当該のファイルが有るディレクトリで下記コマンドを実行してDockerファイルのビルドを試みた。

    $ docker build .
    
  • 下記の様なエラーが出た。

    failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount103727647/Dockerfile: no such file or directory
    

原因

  • Dockerファイルの名前が間違えていた。
    • 誤: DockerFile
    • 正: Dockerfile
  • ファイル名を修正してビルドを行ったところ正常にコンテナが立ち上がった。
  • ビルド後に$ docker imagesで確認したところちゃんとイメージが作成されていた。

    REPOSITORY                        TAG                            IMAGE ID       CREATED              SIZE
    <none>                            <none>                         4178759679c0   About a minute ago   493MB
    
8
4
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
8
4