Docker Community Forums

Share and learn in the Docker community.

Symlinks on shared volumes not supported

(tuxtina) #1

Expected behavior

ln -s foo bar on a shared Docker volume creates a symlink for foo named bar

Actual behavior

I get a message that the operation is not supported.


Docker for Windows beta 7 on Windows 10.

I’d assume that the problem is due to the fact that volumes are mounted through SMB. Would be great if there was a solution/workaround.

(Michael Friis) #2

This is a known limitation (along with lack of inotify support). We’ll be ramping up work on a better filesystem implementation for Windows.

(Alexander Trauzzi) #3

Just wanted to chime in that I’ve just run up against this as well:

npm ERR! nospc ENOTSUP: operation not supported on socket, symlink '../acorn/bin/acorn' -> '/var/www/node_modules/.bin/acorn'

In this case, I’m trying to run npm install inside of a container. On the off-chance that someone else is encountering this issue for the same reason, try tacking on --no-bin-links when invoking npm install. Packages aren’t obligated to play ball, but if it does work, it might be enough to tide one over until the filesystem-level support can be sorted out.

For me, using that flag did get the install to work, but there were runtime issues afterwards as some scripts assume the presence of those symlinks.

(Michael Friis) #4

@atrauzzi out of curiosity, are you running npm restore against with the npm packages being restored to a mounted volume?

(Alexander Trauzzi) #5

Yup! I figure it’s not working because that’s an NTFS filesystem.

For a laugh I tried adding myself as an exception to the NTFS symlink blocking policy, but no dice. I’m sure that’s not even relevant, but it was worth a shot.

(Alexander Trauzzi) #6

@friism - Is this something that’s likely to be addressed and if so, is there anywhere I can follow along or maybe even help with testing?

(Rolf Neugebauer) #7

Hi Alexander

as @friism pointed out we are scoping the work for better host filesystem integration but it is significantly non-trivial due to the inherent differences between NTFS and how Linux filesystems work.


(Alexander Trauzzi) #8

Definitely. Thanks for following up, I’ll wait semi-patiently :slight_smile:

(Rob Landers) #9

@friism: Would probably be a good idea to take a look at syncthing. A service that uses a bittorrent-like protocol to keep remote filesystems in sync across networks. It does pretty well keeping linux/windows fs in sync.

(Alexander Trauzzi) #10

I’d rather not get into adding additional software kludges for this. Seems unnecessary.

(Rob Landers) #11

I didn’t mean as in add a dependency, I meant take a look at the code :wink: It’s golang (or python) I can’t remember.

(Malek77hz) #12

I hope this is useful.
This was a big problem for me. The way I got around it was by making a new folder (with suffix) then mounting the symlink link to that folder. I have to tell my application to use the suffix’d folder instead of the symlink with a switch in my config but works pretty well. Here’s my bash file which searches creates etc

(note, this just works with dirs for now)

(Karatsu) #13

no symlinks … make useless docker on windows for many usage :
exemple :

  • jhipster
  • node modules

(Stevenp) #14

I have to agree with @karatsu

(Lucianocloudpay) #15

I’m facing the same issue. I’m running ‘npm install’ in a docker container on a mounted volume and it fails on symlinks.

Is there a ticket that we can watch & vote for this to be resolved? Thanks

(Martín Coll) #16

Symlinks would be greatly appreciated.

I’m trying to use angular-cli, which is based on ember-cli, but it fails to run the ng serve command because broccoli uses symlinks.

It seems like users can get symlink permissions (see here), it might work for the docker background service too.

EDIT: I just informed myself, and I understand that the problem is in the SMB protocol. Giving permissions won’t change a thing.

(Michael Friis) #17

I’m afraid the problem is not whether windows supports symlinks. The problem is that mounted files are synced between your Windows host and Linux guest (where the Docker engine is running) with the SMB/Samba networking filesystem protocol, and symlinks are not supported there.

We’re working on a better filesystem mechanism, but it will take time.


(Martín Coll) #18

Hey Michael,

I started a discussion with the Bash on Windows team, who developed two filesystems in order to support lots of Linux features (including symlinks!) on Windows.

Maybe you want to participate!

(Pestbeule) #19


I also created a separate etx4 partition and tried with ext2fsd and mounted it in the rare hope to get around this problem.

And I tried to create a data-container with busybox… Also here… No luck.

Do the symlinks really need to be represented at the host too? And if it is just a sync into the container what if the sync ignores symlinks and does not throw errors?

(Clns) #20

Is there any update on this? Without symlinks support on Windows it’s difficult to create a dev environment with docker.