Permissions command inside Dockerfile are not executed

Asked

Viewed 470 times

-1

FROM joomla:3.9-php7.2-apache

RUN apt-get update \
&& apt-get install -y apt-utils vim curl

COPY ./joomla_html /var/www/html

RUN chown -R www-data:www-data /var/www/html/   
RUN chmod -R 777 /var/www/html/tmp                 
RUN chmod -R 777 /tmp      
RUN chmod -R 777 /var/www/html/modules   
RUN chmod -R 777 /var/www/html/components         
RUN chmod -R 777 /var/www/html/administrator/logs                
RUN chmod -R 777 /var/www/html/images               
RUN chmod -R 777 /var/www/html/uploads             
COPY ./docker/php.ini /usr/local/etc/php/conf.d/php-extras.ini             

EXPOSE 80
  • Have some error trying to create the container ?

  • No, it usually creates

  • 1

    Please exchange the various runs for a single RUN. Layer reuse infrastructure may be getting in the way.

  • Solved? Have some issues related to this, tried copying already with the permissions defined?

  • Use one or several RUN does not interfere with the functionality of Dockerfile. Have you tried manually giving permissions inside your container after mounting your image? if yes, what was the result?

1 answer

0

I believe you need to change all files within html/ then simply sub-program all commands from chmod for these:

RUN chmod -R 777 /var/www/html/
RUN chmod -R 777 /tmp

About command chown actually it will not keep setting after mounting the image, recommend making use of the command CMD or run the chown inside the container when he’s running around.

Useful links:

https://stackoverflow.com/questions/26145351/why-doesnt-chown-work-in-dockerfile https://container42.com/2014/11/03/docker-indepth-volumes/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.