Comments (5)
On the contrary, the fix is create the folder and have the fpm user own it instead of avoiding the problem. Using the UID from the host is necessary to avoid having working files written by root or FPM on the host with host volumes and having all sorts of annoyances in dealing with these working files on the host.
The problem is not present in other images or set ups as it is quite standard that the process should be runnable by a UID as overridden with docker-compose or docker run so that in local dev setups permissions are correct on both host and container for the shared files.
from base-images.
In your case, the problems are caused by the user: $UID
entry on your docker-compose - you're trying to execute php-fpm as your own user id within the container and /run
belongs to root. Making that folder globally writable (which you would need if you want to write into it using an arbitrary user id) is not recommended.
from base-images.
How exactly would you create the /run folder in advance if you don't know the user id of whoever's running it? Would need to be created dynamically on php-fpm up, and only root can have write access at /
. Bear in mind also that this needs to run in the mac which use a very different range of user IDs (eg they don't start at 1000for login users like it does on most linux distros).
What files are you creating that you need available back in your host? Caches and whatnot should probably go into /dev/shm.
from base-images.
I'm always happy to receive PR to fix issues btw, if you have clear in your mind how to tackle this particular problem don't be shy 👍
from base-images.
@luispabon i will indeed try to check if I can work out a fix for this, ie you are right assigning the user id in Mac might cause problems but a clear use case (for me) that makes a difference is the use of composer through docker. I tend to use this approach these days and mount the folders, the files are written by the container user if you dont use the host UID and using composer on the host is not an option (in my way of doing things) because of a CI environment I want the minimal set of tooling on the host and instead leverage containerisation everywhere.
Right now I am using the dirty workaround mkdir -p /run && chmod 777 /run
but if I have time I will take a look at why I have not seen this error on other original php images and maybe come up with a PR. Thanks for your time so far
Example of a composer install
composer:
image: composer
user: $UID
depends_on:
- php
volumes:
- $PWD:/app
command: composer install --ignore-platform-reqs
from base-images.
Related Issues (20)
- How can I install php-pear on php7.3 FPM container? HOT 1
- Using phpdocker.io failed to deliver Phalcon
- Partial drive damaged HOT 1
- Using phpdocker.io failed to deliver Datastax PHP-Driver with Apache Cassandra HOT 1
- php-fpm is not running on docker-compose up HOT 4
- Latest version of php71-fpm no longer includes git (incompatible with previous versions) HOT 1
- ENTRYPOINT error HOT 1
- Uncaught PDOException: could not find driver in Command line code:1 HOT 1
- Kubernetes issue
- php74-fpm and pcre error with composer if you install any extension HOT 18
- Remove pcre problem workaround
- PHP 7.3 missing in docker.io registry HOT 1
- PHP 8.* installed on php7.4 and php5.6 image versions HOT 5
- entrypoint.d folder HOT 1
- gd not working with php74-fpm HOT 3
- PHP 8.1 installed on php7.4 image version HOT 6
- Laravel log as image default logging HOT 1
- PHP 4.3.8? HOT 1
- phpdockerio/php:8.1-fpm builds with PHP 8.2 as default version HOT 5
- How to compile and install the PHP-YAF extension, php version 7.2 HOT 1
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 base-images.