Reputation: 307
When starting redis container with the following configuration:
redis:
image: redis
ports:
- "6379:6379"
volumes:
- "/data:/data"
deploy:
placement:
constraints: [node.role == manager]
command: redis-server --appendonly yes
networks:
- webnet
I get the following error in logs:
chown: cannot read directory '.': Permission denied
Upvotes: 1
Views: 1619
Reputation: 307
Finally I figured out that it was related to seLinux on host.
The following command allowed the container to start (but disabled seLinux):
su -c "setenforce 0"
And the following one fixed the problem for good:
chcon -Rt svirt_sandbox_file_t /data
Then I was able to enable seLinux again with:
su -c "setenforce 1"
I found the solution in this post: Permission denied on accessing host directory in docker
Upvotes: 3