thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
791 stars 140 forks source link

permission issues #243

Closed arcdigital closed 3 years ago

arcdigital commented 3 years ago

Hey, I'm trying to build an image using this Dockerfile.

FROM thecodingmachine/php:8.0-v4-apache-node14
COPY ./ /var/www/html/
RUN composer install
RUN yarn install
RUN yarn prod

docker build -t testapp .

I seem to be running into permission issues. The yarn build fails with Error: EACCES: permission denied, open '/var/www/html/public/mix-manifest.json'

Do I need to configure/set something differently for permissions to work properly when building?

I also had issues with the image not being able to modify existing files (I had a vendor folder already and it complained about writing to that too). For this one the folder exists but that file doesn't exist yet.

arcdigital commented 3 years ago

I added --chown=docker:docker to the COPY line and that seemed to fix it.

moufmouf commented 3 years ago

Try to give the files you copy to the "docker" user with

COPY --user=docker

reloxx13 commented 2 years ago

pls add this to readme