[英]Is there a way I can bind mount dot files from a windows host to a linux container?
I am attempting to mount a file from my Windows (Host) to my Linux (Container).我正在尝试将文件从我的Windows (主机)挂载到我的Linux (容器)。 When I mount a single file with a standard extension, everything seems to work fine.当我挂载具有标准扩展名的单个文件时,一切似乎都正常。 However, when I attempt to mount a single file that is a dot-file, it does not work.但是,当我尝试挂载一个点文件的单个文件时,它不起作用。
//This does not work
type=bind,source=${env:USERPROFILE}\\.sample,target=/home/.sample,consistency=cached
// This does work
type=bind,source=${env:USERPROFILE}\\sample.txt,target=/home/sample.txt,consistency=cached
I'm not sure how to specify that the file is a dot file.我不确定如何指定该文件是点文件。 I did notice that if the file did not exist, a folder named .sample was created on my Windows (Host) machine, but that same folder was not created on Linux (Container).我确实注意到,如果该文件不存在,则会在我的 Windows(主机)机器上创建一个名为.sample的文件夹,但在 Linux(容器)上没有创建同一个文件夹。
Are you sure they aren't there?你确定他们不在? Linux treats dotfiles as hidden files, so they aren't visible by just doing an ls
command. Linux 将点文件视为隐藏文件,因此仅通过执行ls
命令就看不到它们。
You can use ls -A
which should show you the hidden dotfiles.您可以使用ls -A
来显示隐藏的点文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.