search

Home  >  Q&A  >  body text

docker数据卷是不能挂载文件的,只能是目录,是吗?

我在run的时候挂载了个空文件试了下,挂载是成功了,但是修改了文件,在容器里面看,是没有文件内容的。
是不是只能挂载目录,不能挂载文件?

黄舟黄舟2768 days ago623

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-26 09:04:10

    You can mount files
    but you cannot change the file inode (after the change, the inside and outside of the container will no longer be the same file)
    How did you modify the file

    reply
    0
  • Cancelreply