【发布时间】:2018-04-21 13:48:53
【问题描述】:
在使用 WSL 和 bash 关注 this tutorial 时,我得到:
~$ cd /tmp/docker-nginx-test
/tmp/docker-nginx-test$ ls -la
total 0
drwxrwxrwx 0 george george 4096 Apr 21 06:27 .
drwxrwxrwt 0 root root 4096 Apr 21 06:02 ..
-rw-rw-rw- 1 george george 18 Apr 21 06:27 Dockerfile
/tmp/docker-nginx-test$ docker.exe build /tmp/docker-nginx-test
unable to prepare context: path "/tmp/docker-nginx-test" not found
还有:
/tmp/docker-nginx-test$ docker.exe build ./Dockerfile
unable to prepare context: path "./Dockerfile" not found
/tmp/docker-nginx-test$ ls -al ./Dockerfile
-rwxrwxrwx 1 george george 18 Apr 21 06:27 ./Dockerfile
与:
$ docker.exe --version
Docker version 18.03.0-ce, build 0520e24
【问题讨论】:
-
你试过
docker.exe build .吗? -
@Cyclonecode 使用
docker.exe build .我得到unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx G:\Documents\workspace\docker\Dockerfile: The system cannot find the file specified.该文件Dockerfile在该目录中不存在。 -
@Cyclonecode 使用(不是无限的)猴子方法,这有效:
/tmp/docker-nginx-test$ docker.exe build ./tmp/Dockerfile。我根本不清楚为什么。在 Windows 中,存在G:\Documents\workspace\docker\tmp\Dockerfile。看来我以某种方式创建了一个从/tmp/docker-nginx-test到/tmp/Dockerfile的符号链接。完全不清楚我是怎么做到的。是时候回顾历史了。 -
我想知道问题是否来自教程的说明
mkdir /tmp/docker-nginx-test && cd $_。如果我一直在 Linux 环境中工作,一切都会好起来的。使用 WSL 和 bash,我没有在明确为“/tmp/docker-nginx-test”的目录中工作。
标签: docker windows-subsystem-for-linux