Docker Community Forums

Share and learn in the Docker community.

Can't mount the local dir if it is a link


(Bill Wang) #1

Not sure if this issue is in boot2docker or docker, and if docker support to mount a folder which is link.

If the mount folder is link:

mkdir /app/datadir 
ln -s /app/datadir /home/datadir
docker run -d -v /home/datadir:/var/lib/mysql --name mysql mysql:5.7.7

get this error:

FATA[0000] Error response from daemon: Could not create local directory '/home/datadir' for bind mount: mkdir /home/datadir: file exists!

If I mount with /app/datadir, it is fine.

My env:

$ boot2docker version
Boot2Docker-cli version: v1.6.0
Git commit: 9894ae9

$ docker version
Client version: 1.6.0