How to mount a directory in the docker container to the host?

后端 未结 5 2172
广开言路
广开言路 2020-12-31 16:05

It\'s quite easy to mount a host directory in the docker container.

But I need the other way around.

I use a docker container as a development environment fo

5条回答
  •  盖世英雄少女心
    2020-12-31 17:05

    Copying the WordPress files to the mounted folder was the solution.

    I move the files in the container from the original folder to the mounted folder and use symbolic links to link them back to the original folder.

    The important part is, the container can follow symbolic links in the container and but the host can't. So just using symbolic links from the original folder to the mounted folder doesn't work, because the host cannot follow symbolic links in the container!

提交回复
热议问题