Docker Community Forums

Share and learn in the Docker community.

How are host volumes mounted in 1.12.0-rc2?

(Dmarkush) #1

Hey all,

I created a docker container on mac, with docker 1.12. It’s a rails app and I’d like to expose the logs directory to the host. It’s done via docker-compose like so:

  image: dmarkush/test
    - "3000:3000"
    - db
    - 'docker/.env.web'
    - './log:/home/app/log'

When I run it on Mac, I get a correct looking directory with the files owned by me. When I run it on a linux box with docker 1.11.2 the permissions are all broken. Docker-compose is version 1.8.0-rc1 in both cases. How is docker Mac managing to avoid permissions issues? Can I replicate this on linux somehow?


(Dmarkush) #2

Ok it looks like on Mac, folders are shared via fuse:

osxfs on /home/app/log type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)

whereas on linux it’s something else:

/dev/disk/by-uuid/1c7ca874-d317-4d81-9aea-a91dccf6782a on /home/app/log type ext4 (rw,relatime,errors=remount-ro,data=ordered)

What can I do so that the user that’s running the app in linux doesn’t run into UID differences between host and container?