I'm dockerizing a bunch of windows apps in Windows Containers.
All my apps require the same mappings, here's a short snippet of my config:
version: '3.9'
services:
shell0:
build:
target: myimage
context: .
image: 'salimfadhley/myimage:latest'
entrypoint: c:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe
working_dir: "c:\\"
volumes:
- type: "bind"
source: "x:"
target: "x:"
volumes: # THIS BIT DOESN'T WORK!
xdrive:
source: "x:"
"xdrive" is a network drive share used by all of my applications. Every single process needs access do "xdrve", that's why I'm bind-mounting this into each service.
I'm doing this by repeating the configuration for every single service in this Docker Compose file. There's going to be quite a few of them. It's going to make my docker-compose file very repetitive.
Is there a way to define the "xdrive" just once, for example in the global "volumes" section? I'd like to be able to do something like this per-service:
...service
volumes:
- xdrive: "x:"
Can it be done? What is the syntax to define a bind-mount globally?