I’m running on raspberrypi3 and I’ve installed NextCloud using a docker-compose.yml file.
The problem is when i mount some volumes the folder is created as root on the host platform (the raspberry). I know this is the default behaviour because docker runs as root but is quite uncomfortable to access data on the raspberry using the pi user (I don’t want use sudo
)
I tried almost everything, I used the option
user: 1000
in the docker-compose.yml but it doesn’t change anything (I got some errors inside the container to access /var/www/html/
folder).
I also tried to create my own Dockerfile using this commands:
FROM nextcloud
RUN mkdir /var/www/html
RUN chown -R pi:pi /var/www/html
USER pi
It didn’t work even in this case.
Is there a way to create the folder on the raspberry as the pi
user instead of root
?
Many Thanks