\Dockerfile: The system cannot find the file specified

12,851

The command docker -t build <my docker file name> . is being misused. It should be:

docker build -t <image-name> -f dockerFile .

where dockerFile is the name you gave to the Dockerfile.

The -t option specifies the tag or name to give to the Docker image.

The -f must be used, if you name the Dockerfile something other than Dockerfile

The . specifies the docker build context.

Share:
12,851

Related videos on Youtube

Mike3355
Author by

Mike3355

Updated on October 12, 2022

Comments

  • Mike3355
    Mike3355 over 1 year

    I have created a docker file to use node.js and nginx. When I run docker -t build <my docker file name> . I get the following error:

    Dockerfile: The system cannot find the file specified.

    Then in the docker file directory I created a folder name web and place my index.html and style.css file in it.

    Question is: Any idea why I am getting this error?

    • Mike3355
      Mike3355 about 6 years
      @yamenk docker -t build <my docker file name> . is as far as I get
    • tgogos
      tgogos about 6 years
      The problem is in the command used. The correct is docker build -t ... not docker -t build ...
  • Mike3355
    Mike3355 about 6 years
    Now I have a bunch of errors in my build. Thanks for the help.