How to mount a single file in a volume

后端 未结 14 1065
隐瞒了意图╮
隐瞒了意图╮ 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:42

    I had the same issue, docker-compose was creating a directory instead of a file, then crashing mid-way.

    what i did :

    1. run the container without mapping the file

    2. copy the config file to the host location :

      docker cp containername:/var/www/html/config.php ./config.php

    3. remove the container (docker-compose down)

    4. put the mapping back and remount up the container

    docker compose will find the config file, and will map that instead of trying to create a directory.

提交回复
热议问题