docker-volume-netshare
docker-volume-netshare copied to clipboard
Files being written to OS and not on EFS
I am using this plugin to mount an efs volume. I can see the efs is mounted in the correct directory when I do df: Output: [ec2-user@ip-10-176-1-61 ~]$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8123812 4121220 3902344 52% / devtmpfs 1920360 104 1920256 1% /dev tmpfs 1928936 0 1928936 0% /dev/shm 10.176.1.116:/ 9007199254740992 0 9007199254740992 0% /var/lib/docker-volumes/netshare/efs/fs-ce45b267
further docker inspect shows that correct directory and volume is mounted
output: { "Name": "fs-ce45b267", "Source": "/var/lib/docker-volumes/netshare/efs/fs-ce45b267", "Destination": "/var/www/data", "Driver": "efs", "Mode": "rw", "RW": true, "Propagation": "rprivate" }
but the data in docker container is not getting in /var/lib/docker-volumes/netshare/efs/fs-ce45b267.
Also when I unmount EFS using umount then I can see the files from container in the directory. So the data from container is actually going to the disk and not to EFS.
What am I doing wrong ?
This is my compose file (I have tried with docker cli as well and same results)
totara: image: docker-registry.svc.xyz.internal/totara:2.9.8 restart: always ports: - "80:80" env_file: - ./common.env volumes: - ${FSID}:/var/www/data/ volume_driver: efs (FSID is correctly being passed from env variable)
I am using amazon linux AMI. Docker version 1.11.1 and v0.19 of the plugin
I have facing the same issue with Docker 1.11.2 and Amazon Linux. Volume driver works on centos 7 though. I'll try and compile from the source code.
It is happening because docker is on a separate mount namespace and there is no MountFlags available. A work around is to mount the folder before starting the docker engine or restarting the engine after mounting the folder. Either way this plugin cannot be used on latest Amazon Linux as is.
PS: since docker engine is started really early in boot sequence you will have to use boothooks to do the mounting.