我正在嘗試將 Windows 檔案共享添加為 Linux docker 容器中的卷
我的 docker.compose 如下
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"
運行命令時出現以下錯誤 docker-compose up -d
.\docker-compose.yml', volume 'driver' 必須是映射而不是字串。
uj5u.com熱心網友回復:
您在 下嵌套不正確volumes。嘗試這個:
volumes:
filewatchshare:
driver: local
driver_opts:
type: cifs
o: username=myuser,password=mypass,rw,domain=mydomain
device: "\\\\sharedfolder\\Reports"
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/347325.html
