How are host volumes mounted in 1.12.0-rc2?

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:

web:
  image: dmarkush/test
  ports:
    - "3000:3000"
  links:
    - db
  env_file:
    - 'docker/.env.web'
  volumes:
    - './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?

Thanks!

1 Like

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?