简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM