mattrayner / docker-lamp

A simple LAMP image using Ubuntu, Apache, PHP and MySql in a single image
Apache License 2.0
592 stars 262 forks source link

Slow startup #129

Open gleniat opened 2 years ago

gleniat commented 2 years ago

run.sh uses chown -R which is very slow. If you have more files in /app then the startup can take up minutes.

Probably the same problem as described here. https://github.com/docker/for-linux/issues/388

mattrayner commented 2 years ago

This is a hard one as far as a fix is concerned. The crown step ensures that you are able to read and write files in docker land and on the host machine. There’s not much of a ‘fix’ possible

On Mon, 31 Jan 2022 at 17:07, gleniat @.***> wrote:

run.sh uses chown -R which is very slow. If you have more files in /app then the startup can take up minutes.

Probably the same problem as described here. docker/for-linux#388 https://github.com/docker/for-linux/issues/388

— Reply to this email directly, view it on GitHub https://github.com/mattrayner/docker-lamp/issues/129, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2XGNU6MPYYQPVPXWTO7WLUY26T5ANCNFSM5NG2LBDA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Matt Rayner http://www.mattrayner.co.uk/

gleniat commented 2 years ago

Hi mattrayner! Thanks for your quick reply. They suggest to use chown in COPY/ADD command.

something like this COPY --chown=www-data:staff app/ /app or ADD --chown=www-data:staff app/ /app