Mount single file from volume using docker-compose

ぃ、小莉子 提交于 2020-01-25 11:12:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!