Comments (7)
@RadeJR
I overlooked this functionality, thank you so much for all the care, explanations, and availability!
I'm seating back again for the afternoon and will dive in, for sure it will solve it, it has everything for it!
@jaydrogers
Oh boy, sorry, totally forgot about Discussions!
I need some vacations!!
I'll make some YouTube content with this, it's so so good!!!
Thank you again, @RadeJR and and @jaydrogers
from docker-php.
Hi!
I'm not Jay but I'd like to help by sharing how we solved this problem.
Since these images are now using non-root user by default, you can use 2 scripts to modify UID and GID of the default www-data user.
Dockerfile example:
FROM serversideup/php:beta-8.2-fpm-nginx
USER root
# Save the build arguments as a variable, you can specify whatever uid/gid you would like to use, in your example you can use 1000:1000
ARG USER_ID=1000
ARG GROUP_ID=1000
# Use the build arguments to change the UID
# and GID of www-data while also changing
# the file permissions for NGINX
RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
\
# Update the file permissions for our NGINX service to match the new UID/GID
docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx
# Drop back to our unprivileged user
USER www-data
This will enable you to run containers as the user you created and allow them to read/write to mounted volumes.
Let me know if you have more questions or if i didnt answer something!
from docker-php.
I was sure that there were docs for this exact issue but I didn't manage to find them before posting my previous response.
Here's the link:
https://serversideup.net/open-source/docker-php/docs/guide/understanding-file-permissions
You have an example of Dockerfile and docker-compose.yml that you can use in development.
I hope that these docs solve your problem, but if you need anything else, let me know.
from docker-php.
Hey @RadeJR
I definitely forgot there are more people that see this! I'm very welcome to feedback from everyone!!
This sure helps a lot!! I have to try it!
Something I'm missing is, when in local (dev), if the base image has everything I need, should I need to build as well with current uid and gid?
from docker-php.
and thank you so so much for feedback @RadeJR
from docker-php.
Thanks for chiming in @RadeJR! Yes, using the example above is the way.
Any other questions, @ijpatricio open a discussion and I'd be glad to help!
from docker-php.
Something I'm missing is, when in local (dev), if the base image has everything I need, should I need to build as well with current uid and gid?
Probably yes to solve the problem with sync with volumes. If you use volume in your local environment, the files will be synced and belongs to your host user (1000) but in container this user doesn't exists.
A "dev" image was a nice catch to solve this problem when using in local environment or even in main image, using environment variables, for example:
environments:
- UID: 1000
- GID: 1000
from docker-php.
Related Issues (20)
- More typos HOT 4
- PRs fail because of the Nuxt content ENV not being set
- PRs fail because of Docker Logins are not set HOT 6
- I encountered issues with some vulnerabilities but couldn't find a way to update the dependencies. HOT 6
- Adding custom script fails to start HOT 2
- gRPC can't be found anymore! HOT 1
- Nginx Unit Docker Image Exposes Ports 80 and 443 alongside 8080 and 8443? HOT 1
- ⚠️ Delayed release of v3.1.0 HOT 1
- mkdir() "/var/lib/nginx/body" failed (13: Permission denied) HOT 3
- Cannot start SSUPv3 docker image on Google CloudRun HOT 10
- Improve Horizon Support HOT 3
- nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/site-opts.d/https.conf:2
- Apache container fails to restart HOT 5
- CrashLoop in K8s HOT 1
- Scheduler not working with S6 in new V3 images HOT 3
- Custom start up script not executing HOT 1
- Running the image on Azure and other major cloud providers
- Nginx boots up and starts accepting connections when running a non default command. HOT 7
- nginx apt repository GPG expired HOT 10
- Allow FastCGI parameters to be set via environment variable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-php.