![](/img/trans.png)
[英]How can I access my device from a windows host to a docker linux container?
[英]Is there a way I can bind mount dot files from a windows host to a linux container?
我正在嘗試將文件從我的Windows (主機)掛載到我的Linux (容器)。 當我掛載具有標准擴展名的單個文件時,一切似乎都正常。 但是,當我嘗試掛載一個點文件的單個文件時,它不起作用。
//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
我不確定如何指定該文件是點文件。 我確實注意到,如果該文件不存在,則會在我的 Windows(主機)機器上創建一個名為.sample的文件夾,但在 Linux(容器)上沒有創建同一個文件夾。
你確定他們不在? Linux 將點文件視為隱藏文件,因此僅通過執行ls
命令就看不到它們。
您可以使用ls -A
來顯示隱藏的點文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.