-
Notifications
You must be signed in to change notification settings - Fork 2.2k
mysql:5.5: can't chown on nfs mount #153
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
Comments
It seems inside Docker, I only have write access in the directory if I give it permission 777 outside Docker. chmod still fails. |
What if we wrap the chown in an if statement to check the permissions? # the simlest way is to be the user and check if they can write
# but that means we would need gosu to change users
if ! gosu mysql bash -c "test -w '$DATADIR'"; then
chown -R mysql:mysql "$DATADIR"
fi What do you think @ltangvald? |
I guess it could potentially fail if $DATADIR is writeable but, say, $DATADIR/mysql isn't, but I don't really see any reasonable cases where that would be the case, so I think it looks good :) |
Another option would be something like what we've done in several other images, allowing for This way, folks who wanted to skip the chown could use |
I do completely agree with what @tianon has said about allowing --user variable. |
Yeah, I think that sounds pretty good |
After Without --user:
Output:
With --user:
Ouput:
More info:
The solution would be that chown should not be used, but instead, userID en goupID of mysql should be changed to match those of the values of --user or those of the existing directory. Something like...
|
That change isn't published to the Hub just yet; see docker-library/official-images#1740 |
Running mysql:5.5 with
/var/lib/mysql
mounted on a nfs file system, I get this error:I edited the entrypoint script to see if I had write access in
/var/lib/mysql
, and I have, and files I create in the entrypoint script are created in the mounted directory. It's just the chown that fails, and at that point, the script fails.It works fine on an ext4 file system on the same machine, and then the result of chown is
999:localadmin
The text was updated successfully, but these errors were encountered: