I have a Stack deployed to my swarm and I’m trying to create named local volumes managed by Docker to persist some things. I have two services, each has it’s own volume, however only one of them works - has read/write access to the volume. I noticed that the container that works runs as root and the other one runs as another user (uid:1000).
I am using a docker-compose.yaml file to configure like so:
volumes: - my_volume:/some/directory/in/container:Z
The container that DOES NOT have write permissions to the volume runs on
CentOS and has user
uid 1000. I have tried this with and without the
:Z flag. My docker verison is
17.03.1-ce, build c6d412e.
Does anyone has any idea what I’m missing here? Is this supposed to work with non-root users as well?