Copying files to a container with Docker Compose

后端 未结 1 1307
北恋
北恋 2020-12-07 15:33

I have a Dockerfile where I copy an existing directory (with content) to the container which works fine:

Dockerfile

FRO         


        
相关标签:
1条回答
  • 2020-12-07 16:07

    Given

        volumes:
          - /dir/on/host:/var/www/html
    

    if /dir/on/host doesn't exist, it is created on the host and the empty content is mounted in the container at /var/www/html. Whatever content you had before in /var/www/html inside the container is inaccessible, until you unmount the volume; the new mount is hiding the old content.

    0 讨论(0)
提交回复
热议问题