php - How to share a Laravel app codebase in a Docker container while preserving permissions? -
i've created dockerfile containerize laravel app local development environment.
so far i've achieved of need, however, every command ran container (like composer install
, such) alter codebase files containerized root
's uid , generate permissions conflicts in host machine.
so far, dockerfile
https://github.com/timegridio/dockerfiles , my project codebase (in case needed).
on research, i've tried hints given on this question , recommendations of article, believe seem pretty close of need. had no success aproaches , got errors (see question comments pasted outputs, did not want mix approach on question yet.).
thanks time!
everything make in build process (in dockerfile) won't alter have in host machine. happens after in docker exec
or application alter files. when execute container specify host uid , gid:
docker run -p 8000:8000 -v ~/timegrid/:/var/www/timegrid -u=<uid> -g=<gid> timegrid:latest
everything made these ids. if application behaves badly, need specify user
directive in dockerfile before directory creation.
host mounted volumes complicated in way , permission things give headaches. can define user same ids host user, dockerfile work you. if decide way can use aux
directive specify ids.
regards
Comments
Post a Comment