Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

\Dockerfile: The system cannot find the file specified

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?

like image 925
Mike3355 Avatar asked Jan 31 '18 13:01

Mike3355


1 Answers

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.

like image 54
yamenk Avatar answered Oct 17 '22 03:10

yamenk