Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerfile Build Error: The system cannot find the path specified

C:\kafka> docker build Dockerfile
[+] Building 0.0s (1/2)
 => ERROR [internal] load build definition from Dockerfile                                                                                               0.0s
 => => transferring dockerfile: 63B                                                                                                                      0.0s
------
 > [internal] load build definition from Dockerfile:
------
failed to solve with frontend dockerfile.v0: failed to read dockerfile: error from sender: walk Dockerfile: The system cannot find the path specified.

Above is an example of the error I am getting and the command run. My Dockerfile is named "Dockerfile" as I have read on many answers but still no resolve. My Dockerfile is also within the directory I am in.

like image 726
Harvey Avatar asked Jan 19 '21 15:01

Harvey


1 Answers

To build a docker image:

cd /path/where/docker_file/lives
docker build .

Above is same as:

docker build -f Dockerfile .

You need to specify Dockerfile name only if it is not default:

cd /path/where/docker_file/lives
docker build -f Dockerfile.modified .
like image 167
muradm Avatar answered Nov 03 '22 20:11

muradm