I am trying to add a windows file share as a volume in a Linux docker container
my docker.compose is as follows
version: '3.4'
services:
dealproducer:
image: MyService:latest
build:
context: .
dockerfile: MyService/Dockerfile
volumes:
- ./sidecar/shm:/dev/shm
- ./sidecar/ORG.conf:/etc/krb5.conf.d/ORG.conf
depends_on:
- authentication
authentication:
image: myorg:101/ubi8/kerberos-sidecar:latest
volumes:
- ./sidecar/shm:/dev/shm
- C:/temp/keytab/xbrmdock.keytab:/krb5/krb5.keytab
environment:
- SERVICE_ACCOUNT=srvcaccad
volumes:
filewatchshare:
driver: local
driver_opts:
type: cifs
o: username=myuser,password=mypass,rw,domain=mydomain
device: "\\\\sharedfolder\\Reports"
I get the following error when I run the command docker-compose up -d
.\docker-compose.yml', volume 'driver' must be a mapping not a string.
CodePudding user response:
You have incorrect nesting under volumes
. Try this:
volumes:
filewatchshare:
driver: local
driver_opts:
type: cifs
o: username=myuser,password=mypass,rw,domain=mydomain
device: "\\\\sharedfolder\\Reports"