Giter Site home page Giter Site logo

Comments (5)

bizmate avatar bizmate commented on July 19, 2024 1

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.

luispabon avatar luispabon commented on July 19, 2024

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.

luispabon avatar luispabon commented on July 19, 2024

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.

luispabon avatar luispabon commented on July 19, 2024

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.

bizmate avatar bizmate commented on July 19, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.