-
Notifications
You must be signed in to change notification settings - Fork 102
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
Do not use www-data as default user #22
Comments
Also, we now have |
Hi there. Many thanks for your hard work, this is a definitively a great step forward. Don't know if I'm asking too much, but do you think that could be possible to set the wodby uid/gid using variables on container basis, in a future version? In our shop we've adopted your images as base for pretty much everything we do with Drupal and Wordpress, but we use a mixture of host machines (mostly Macs and some flavors of Linux) for local development so having the ability to set custom ids would be insanely great. |
@proteo do you want to have docker build arguments for that? are you going to rebuild the image? What kind of issues do you experience with non-matching uid/gid? |
Hi @csandanov, we're actually using slightly modified versions of your repos to build customized images to match a specfic |
I guess we could add a macos image variant with 501:20 for uid/gid. But what kind of issues do you have with non-matching uid/gid in your local environment? |
Well, one of the most common and recurring issues is with with D7 projects (yes, we still pretty much live in the D7 realm) where you don't really have a standard process to add new code or even update the existing one. So peeps keep throwing files and never remember to update/change file permissions. But, from your response I assume that setting uid/gid per container is not a feasible thing? |
The solution with updating uid/gid is not feasible because you have to be root to perform any manipulation with Could you please clarify why do you need to change file permissions for new code? You probably add it from the host machine via git or copying, why would you need to change it? It's still have read permissions for php-fpm so it shouldn't be a problem. |
|
@csandanov absolutely fantastic, thank you very much. You're right, adding code with a different uid is no a major issue because it still can be read. It's more like the purpose of having the 1000 uid matching the user in Linux. |
@csandanov How should I use the build arguments in a docker-compose file? Would be nice if rebuilding this image would always take the users uid as a variable. |
My php section looks like this.
|
You can't do that via docker-compose file, you'll have to build your own images with build args. |
Hello. I have a similar issue with users and permissions. First, I'm working with Docker for Windows on Windows 10. I have more or less the D4D stack with some config changes, but the main change is that I use the The problem with Magento (1 and 2) is, that it of course like Drupal write permissions for the content files directory needs, but not only. Additionally it has a Now my problem with the container is, that neither Magento executed via the browser nor the Magento CLI tool can delete, modify or create files due to permission problems. At least the CLI tools reports this, and the web frontend is plain HTML, so obviously generated CSS files could not be created. |
I have a pretty critical issue with this approach using gitlab ci on my staging server. |
That's why the image has |
I'm sorry but I'm not sure what do yo mean. Another option if I get into the container as www-data and run drush, it creates folders but then I'm not able to remove it as a gitlab-runner user on my server because I don't have user 82. |
Well, what would you do if these weren't containers? You install a project via drush and it creates directories from your user, that's expectable and you should set correct ownership/permissions afterward for fpm user. Alternatively, you can always change the container's default user and fpm user if you want to, use the same user for everything or use root everywhere, it's up to you. |
Thank you! I'm not an advanced docker user. Just trying to find the best way and of course, it's preferable to use a native solution (which is supposed to be used in such cases). Thank you for making time to answer! |
Just noting for those with file permissions after the
|
root
as the default userwww-data
. Userwww-data
(uid/gid 82) is a de-facto standard in Alpine Linux for php-fpm, nginx, apache packages, something similar towww-data
in Debian/Ubuntuphp-fpm
(1000) in 3.5.0www-data
is completely wrong, it's a standard system user that comes with a "package" similar towww-data
in Debian/Ubuntu that should be used only to run a package daemon, so it's not a usual Linux user and should not be used to log in and manage fileswodby
with uid/gid1000
to match user in most Linux distributions. PHP-FPM will run via sudo with FPM user/group set towww-data
(82). Userwodby
will be a part ofwww-data
group.Feb 16th UPDATED:
wodby
added towww-data
groupThe text was updated successfully, but these errors were encountered: