1

I've installed a fresh Fedora Server 22. During the setup I selected the option to pre-install Docker. I have activated Docker using Cockpit and installed a new container on the command line:

# docker run -d -h plex --name="plex" -v /etc/docker/plex:/config -v /tank:/data -p 32400:32400 timhaak/plex

When trying to run it I get the error:

+ GROUP=plextmp
+ mkdir -p /config/logs/supervisor
mkdir: cannot create directory ‘/config/logs’: Permission denied

I've checked the container details:

...
"Volumes": {
    "/config": "/etc/docker/plex",
    "/data": "/tank"
...
"VolumesRW": {
    "/config": true,
    "/data": true
...

and the directory exists:

# file /etc/docker/plex
/etc/docker/plex: directory

everything seems to be fine.

At first I thought there was a problem with the container itself so I tried other containers as well. I encounter the same problem with each of them. They cannot create folders or files (sometimes not even read them). In the docker documentation ("Managing data in containers") there is a very easy example of creating a new container that simply opens a shell and mounts a volume from the host:

# docker run --rm -it -v /etc/docker/test:/vol ubuntu /bin/bash

Trying to touch a file in /test results in a permission denied error.

Is there anything I am missing?

1

In my specific case the problem was with SELinux. After setting it to "permissive" I was able to use the containers.

(might not be the best of solutions but works until I setup the SELinux permissions accordingly)

Update: Here is a short blog post from Dan Walsh pointing out possible issues that may arise from using Docker Volumes and SELinux:

http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/

  • Please complain to Dan Walsh. He was supposed to have implemented an SELinux policy to define a directory for data volumes, some time ago in fact, but as of today I don't see it. – Michael Hampton Jul 14 '15 at 17:48
  • Thanks for the information. In case anybody else faces this problem there is a blog post from Dan Walsh pointing out the pitfalls of using Docker and SELinux: projectatomic.io/blog/2015/06/… – b0wter Jul 16 '15 at 7:57
  • 1
    Ah, he did provide a solution, it just never wound up on my desk. – Michael Hampton Jul 16 '15 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.