Docker Wordpress tar: <file> Cannot change ownership to uid 33, gid 33: Operation not permitted
The error is reported by tar command that try to change owner.
In order to avoid tar to set owner you can set variable TAR_OPTIONS
to --no-same-owner
From tar manual:
--no-same-owner
Extract files as yourself (default for ordinary users).
You can add this in your docker-compose file with :
TAR_OPTIONS: --no-same-owner
The problem that you are having is that you are mounting a local volume with your user's permissions, and not www-data
. As such, www-data
is not able to change the permissions of files that your user owns. To fix it, you should be able to do chown 33:33 -R /Users/myuser/Sites/dockertest/wp-data/wp-content
. Keep in mind that if you get and error something like Permissions denied
, run the command with sudo
.
First, you could try setting the additional volume option of nocopy to True.
If that doesn't work maybe you check the groups www-data is part of.I think in case you want to set the user and group to www-data, ensure www-data is part of the same group as the nfs shared folder.
Else it is preferred to use a local user and group that has access to the nfs file.
APACHE_RUN_USER : local_userAPACHE_RUN_GROUP : local_group