How to mount a single file in a volume

后端 未结 14 1025
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 10:16

I am trying to dockerize a PHP application. In the dockerfile, I download the archive, extract it, etc.

Everything works fine. However, if a new version gets released

14条回答
  •  感情败类
    2020-11-27 10:28

    Use mount (--mount) instead volume (-v)

    More info: https://docs.docker.com/storage/bind-mounts/

    Example:

    Ensure /tmp/a.txt exists on docker host

    docker run -it --mount type=bind,source=/tmp/a.txt,target=/root/a.txt alpine sh
    

提交回复
热议问题