I tried mount Windows Shared Folder with in container.
So, I wrote docker-compose.yml file below, but mount directory owner is root and writeable only owner user.
version: '3'
services:
php:
container_name: php
build: ./docker/php
volumes:
- cifs:/shared
restart: always
volumes:
cifs:
driver: local
driver_opts:
type: cifs
o: username=(username),password=(password),rw,domain=(domainname),uid=1000,gid=1000
device: "\\\\(ipaddress)\\shared"
$ sudo docker-compose exec php bash
$ ls -l /...
drwxr-xr-x 2 root root 4096 Jun 24 07:27 shared
...
By the way, I executed below command at host.
sudo mount -t cifs -o username=(username),password=(password),domain=(domainname),rw,uid=1000,gid=1000 //(ipaddress)/shared /shared
and I modified docker-compose.yml file below, could mount cifs volume by other than root user.
version: '3'
services:
php:
container_name: php
build: ./docker/php
volumes:
- /shared:/shared
restart: always
$ sudo docker-compose exec php bash
$ ls -l /...
drwxr-xr-x 2 1000 1000 4096 Jun 24 07:27 shared
...
Tell me how to mount cifs volume by other than root user without host mount.
Hi @matyuda,
We don't use GitHub to handle user questions. Please use either our forum or our community Slack.
Hi @chris-crone
Thank you for replying.
I will ask question in the forum.
I asked quesion in the forum. But no replied.
https://forums.docker.com/t/how-to-mount-cifs-volume-by-other-than-root-user/77467
Most helpful comment
I asked quesion in the forum. But no replied.
https://forums.docker.com/t/how-to-mount-cifs-volume-by-other-than-root-user/77467