问题
For local dev I need to mount a different config file in a Docker container. This is easy with the command line -v $(pwd)/bla.yaml:/location/bla.yaml. Is it possible to do this from a volume (created with docker volume create bla) in a docker-compose file?
回答1:
You should be able to do it with a bind mount:
version: "3.2"
services:
app:
image: app:latest
volumes:
- type: bind
source: ./bla.yaml
target: /location/bla.yaml
来源:https://stackoverflow.com/questions/54657370/mount-single-file-from-volume-using-docker-compose