Alpine - Recursively chmod files and folders?

0

I am creating a docker image in which I have to give permissions to few files and folders so that all user can access specific locations and run the image as another user so that no one can access my code deployed in tomcat server.

How can I recursively chmod all the files and folders under one folder?

I tried the following line in dockerfile:

RUN find /usr/local/tomcat/conf/ -type f -exec chmod 777 {} \;

But it is not working.

Mangesh Narkhede

Posted 2019-02-15T08:46:38.733

Reputation: 1

1Are you wanting to change permissions to 777 for all files and directories? The -type f only changes files. Is that what you mean when you say "But it is not working"? Saying only that it is not working doesn't tell us anything. In what way is it not working compared to what you expect? – n8te – 2019-02-15T09:08:15.273

@n8te I meant that when I give permission to folders using find /usr/local/tomcat/conf/ -type f -exec chmod 777 {} ; this command I am unable to access this folder by the user other than root user. – Mangesh Narkhede – 2019-02-15T12:10:21.300

No answers