在Docker for Windows中创建符号链接失败,它不受支持吗?

时间:2017-03-26 14:56:35

标签: linux docker docker-compose symlink

我有一个运行Ubuntu Server的docker容器。我正在运行Docker for Windows,我分别安装了以下版本的Docker和Docker Compose:

> docker-compose -v
docker-compose version 1.11.2, build f963d76f

> docker -v
Docker version 17.03.1-ce-rc1, build 3476dbf

这是我迄今为止没有成功的尝试:

// The dojo linked file exists so I've tried to update it as per this answer (http://stackoverflow.com/a/1951752/719427)
> docker exec -it dockeramp_webserver_1 ln -sf /var/www/html/externals/dojo /var/www/html/externals/public_html/js/dojo
ln: failed to create symbolic link '/var/www/html/externals/public_html/js/dojo': No such file or directory

// I have deleted the previous linked file and then I tried to create a new one
> docker exec -it dockeramp_webserver_1 ln -s /var/www/html/externals/dojo /var/www/html/externals/public_html/js/dojo
ln: failed to create symbolic link '/var/www/html/externals/public_html/js/dojo': No such file or directory

// removed the directory name from the link name
> docker exec -it dockeramp_webserver_1 ln -s /var/www/html/externals/dojo /var/www/html/externals/public_html/js    
ln: failed to create symbolic link '/var/www/html/externals/public_html/js': No such file or directory

因为错误一直说目录不存在,所以我检查错误是对还是错:

> docker exec -u www-data -it dockeramp_webserver_1 ls -la /var/www/html/externals/dojo
total 80
drwxr-xr-x 2 root root     0 Mar 25 15:09 .
drwxr-xr-x 2 root root  4096 Mar 25 15:09 ..
drwxr-xr-x 2 root root     0 Mar 25 15:09 dijit
drwxr-xr-x 2 root root     0 Mar 25 15:09 dojo
drwxr-xr-x 2 root root     0 Mar 25 15:09 dojox
drwxr-xr-x 2 root root     0 Mar 25 15:09 mmi
-rwxr-xr-x 1 root root 74047 Mar 25 15:09 tundra.css

> docker exec -u www-data -it dockeramp_webserver_1 ls -la /var/www/html/public_html/js
total 24
drwxr-xr-x 2 root root 4096 Mar 26 14:40 .
drwxr-xr-x 2 root root 4096 Mar 25 15:11 ..
-rwxr-xr-x 1 root root 7123 Mar 25 15:09 jquery.PrintArea.js
-rwxr-xr-x 1 root root 6141 Mar 25 15:11 quoteit_delegate_search.js

它们都存在......我在这里缺少什么?它在Windows中不受支持吗?我发现开发团队在以前的版本中添加了一个名为mfsymlinks的东西。

1 个答案:

答案 0 :(得分:0)

该命令告诉您/var/www/html/externals/public_html不存在。您只显示存在/var/www/html/externals/dojo/var/www/html/public_html/js文件夹。我相信这是你命令中的一个简单错误。