Docker Community Forums

Share and learn in the Docker community.

Are OSX-style host volume file permissions possible on linux?

docker

(Donald Guy) #1

I’ve been putting together some build containers that create a debian package in a known (container) environment using source code on host disk.

This is to say, containers which are intended to be invoked as
docker run --rm -v $PWD:/build donaldguy/build-foo
and output a file in the current directory

These are working great on OSX with docker-machine, and running into all kinds of permissions issues on the linux build server.

It is apparent (evident upon running the container interactively and ls -ling) that on OSX the process of mounting the volume is somehow transparently remapping the file owner to the container’s user (set as a USER line in the Dockerfile), whereas on linux they are retaining the exact permissions as on the disk of the host machine.

How does the OSX setup achieve its remapping? is there a way I can reproduce it on linux? I would be willing to change storage drivers, daemon options, etc. as well as upgrade kernel

Thanks for helping me with this frustrating issue :smiley: