0

I want to bind a volume (which is CIFS mounted drive) to my Docker service. I have the following entry in /etc/fstab file:

100.100.100.100 /media/images cifs username=testuser,password=testpassword,iocharset=utf8,sec=ntlmssp 0 0

I can read and write to /media/images. When I bind this path to Docker service, it starts up but application (.NET Core) doesn't produce any output which is weird. If I remove the volumes section, it works without any problems and I can see application output.

version: "3.7"
services:
  web:
    image: myimage:1.2.3
    volumes:
      - "/media/images:/app/mount/images"

I start the service with docker stack deploy. There aren't any logs so I can't see what went wrong. The container is up but application isn't working and isn't producing any logs. If I go inside container I can see that volume is mounted and I can read and write to it.

Why doesn't application work when I bind this volume and why are there no logs?

Sam Carlson
  • 1,891
  • 1
  • 17
  • 44
  • Just for test, have you tried running the container as `privileged` ? – Mike Doe Feb 12 '20 at 08:47
  • This is a Docker service. If I add `privileged: true` under `image:...` and deploy it with `docker stack deploy` it outputs: `Ignoring unsupported options: privileged`. – Sam Carlson Feb 12 '20 at 08:51
  • I added `command: ["--privileged"]` to my service definition. The previous error is gone but application still doesn't work and there are no logs... – Sam Carlson Feb 12 '20 at 08:57
  • Does this answer your question? [Mount SMB/CIFS share within a Docker container](https://stackoverflow.com/questions/27989751/mount-smb-cifs-share-within-a-docker-container) – Mike Doe Feb 12 '20 at 10:01
  • No. I have CIFS share mounted on my host machine and I want to reference *this* mounted folder in volumes section in docker-compose.yml. I actually did exactly the same as [this answer](https://stackoverflow.com/a/56711656/10489583). I am able to create files inside container and it is reflected on shared drive, but for some reason application doesn't start if shared folder is mounted. – Sam Carlson Feb 12 '20 at 11:08

0 Answers0