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.
以上是我遇到的错误和命令运行的示例。我的 Dockerfile 被命名为“Dockerfile”,因为我已经阅读了许多答案,但仍然没有解决。
我的 Dockerfile 也在我所在的目录中。
最佳答案
要构建 docker 镜像:
cd /path/where/docker_file/lives
docker build .
上面是一样的:docker build -f Dockerfile .
您需要指定 Dockerfile
仅当它不是默认值时才命名:cd /path/where/docker_file/lives
docker build -f Dockerfile.modified .
关于Dockerfile 构建错误 : The system cannot find the path specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65794617/