Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
github分支上的Docker生成找不到指定的文件_Git_Docker_Docker Build - Fatal编程技术网

github分支上的Docker生成找不到指定的文件

github分支上的Docker生成找不到指定的文件,git,docker,docker-build,Git,Docker,Docker Build,我正在尝试使用以下命令在Windows 10上构建Docker映像: docker build -t cron_runner . 但是,我得到以下错误: unable to prepare context: unable to evaluate symlinks in context path: readlink C:\Users\xxx\Tools\Internal_Tools: The system cannot find the file specified. 文件夹中有一个标准Doc

我正在尝试使用以下命令在Windows 10上构建Docker映像:

docker build -t cron_runner .
但是,我得到以下错误:

unable to prepare context: unable to evaluate symlinks in context path: readlink C:\Users\xxx\Tools\Internal_Tools: The system cannot find the file specified.
文件夹中有一个标准Dockerfile,没有扩展名。但是,该文件夹位于不是主文件夹的git分支上


如果我将docker文件从Git文件夹移到本地文件夹中,docker映像将毫无问题地生成,因此我认为问题在于它位于分支上,因此存在符号链接问题。

当您运行
docker build
时;docker复制您的上下文;这是Dockerfile所在的整个目录(使用.dockergnore时除外)


似乎Dockerfile所在的目录中有一个(断开的?)符号链接;因此,要么清理父目录;或者将Dockerfile移动到一个干净的子目录中。

你说的“清理”是什么意思?这是一个带有分支的初始git项目。是我切换分支破坏了符号链接吗?git分支不影响这一点;它只是文件系统。进入Dockerfile所在的目录并运行
ls-la
;然后,您可能会发现损坏的符号链接。您一定在某个地方创建了指向内部工具的符号链接?我没有,但我只是将项目的根文件夹移出并重新制作了它,它就可以工作了。我没有链接,奇怪。