-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker volumes using the :z or :Z flag don't create the folder on the dockerd host #17262
Comments
docker infoContainers: 3 docker versionClient: Server: Linux dhcp-10-19-62-196.boston.devel.redhat.com 4.3.0-0.rc5.git1.1.fc24.x86_64 #1 SMP Wed Oct 14 15:47:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux |
Ok I will close my bug as not a bug and can close this issue. |
Note that it is unintentional that this is happening, I'm not sure why it is at the moment.. maybe Relabel is called before the dir is created? |
I'm reopening this since we still have this issue with selinux z and Z and since #21666 |
@runcom do you have an idea how to solve it as well? Is it safe to put it on a milestone already? |
@thaJeztah not sure, @rhatdan might have an idea better than me on solving this one. |
Oops I think this is a different issue |
Since this was brought back, I have submitted a patch to create the directory if it does not exist and the user specified a relabel. |
I have a bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1274210 that is reporting that SELinux volume options "z" & "Z" do not act the same way as "ro", "rw". In that if you specify a non existent directory
in the docker run/create command, docker creates the directory when using "ro", "rw", while it fails with an error in the "z", "Z" case.
I believe that creating the directory in the case of bind mounts is a bug, since this could lead to unexpected behaviour and even leave users confused when they have a simple typo.
docker run -v /var/lib/mariedb:/var/lib/mariadb ...
For example could potentially end up with a directory on the host that was not expected. Forcing the user to do a
mkdir /var/lib/mariadb
does not seem to onerous.If the "ro"/"rw" behaviour is the expected, I will submit a patch to fix the SELinux issues.
The text was updated successfully, but these errors were encountered: