Score:0

"chmod -R ug+rwx" not working in Dockerfile

es flag

I am dockerizing php laravel application so my dockerfile looks like below, I am getting operation not permitted error after chmod command. Does anyone face this issue

RUN usermod -u 1000 www-data
COPY --chown=www-data:www-data . /var/www/html
USER www-data

RUN chown -R $USER:$USER /var/www/html/storage/*
RUN chown -R $USER:$USER /var/www/html/bootstrap/*
RUN chown -R $USER:$USER /var/www/html/public/*


RUN chmod -R ug+rwx /var/www/html/storage/*
RUN chmod -R ug+rwx /var/www/html/bootstrap/*
RUN chmod -R ug+rwx /var/www/html/public/*

jp flag
I just tested it and it does work. Maybe you are confused because you want the containing folder changed as well? The `*` glob doesn't contain the containing folder so it will only match all files and folders underneath `storage`, `bootstrap` and `public`. If you want them to be included just remove the `*` at the end.
rumon avatar
es flag
When i run first time it works. But the main problem is if you run docker file again it ends up with operation not permitted. Can you please run dockerfile again.
jp flag
I don't see what you mean. Works the same even multiple times
rumon avatar
es flag
Thanks man for you help. It's working now after rebuild
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.