Windows 上 Docker 中的 ls 不显示一个目录

Windows 上 Docker 中的 ls 不显示一个目录

我正在运行 Windows Server 2016 Datacenter 版本 1607(内部版本 14393.6614)和 Docker Desktop Community 版本 2.0.0.3(31259)。

我正在以交互模式运行 Ubuntu docker 容器,并将 C 盘挂载到容器中。这是我以提升的 PowerShell/mnt/c用户身份运行的命令:afish

docker run -a stdin -a stdout -t -i --security-opt seccomp:unconfined -v C:\:/mnt/c ubuntu:23.10 /bin/bash

然后我去/mnt/c执行ls -al,这些是我得到的目录:

root@047daede994f:/# cd /mnt/c
root@047daede994f:/mnt/c# ls -al
total 393
drwxrwxrwx 2 root root   8192 Feb  5 15:25  .
drwxr-xr-x 1 root root   4096 Feb  8 13:08  ..
drwxrwxrwx 2 root root      0 Jan 20 18:19  Afish2
drwxrwxrwx 2 root root      0 Feb 26  2023  Afish2_SSD
drwxrwxrwx 2 root root      0 Feb  6 14:25  Afish3
drwxrwxrwx 2 root root      0 Feb 18  2023  Afish3_SSD
drwxrwxrwx 2 root root      0 Feb  8 10:25  Afish5
drwxrwxrwx 2 root root      0 Jan  1  2023  Afish5_SSD
drwxrwxrwx 2 root root      0 Dec  9 09:49  Afish6
drwxrwxrwx 2 root root      0 Dec  9 09:19  Afish6_SSD
drwxrwxrwx 2 root root      0 Sep  1  2021  Afish_SSD
drwxrwxrwx 2 root root      0 Dec  9 09:58  Afish_unencrypted
-rwxr-xr-x 1 root root      1 Jul 16  2016  BOOTNXT
drwxrwxrwx 2 root root   4096 Jan 30 06:49 'Documents and Settings'
drwxrwxrwx 2 root root      0 Sep 12  2016  Logs
dr-xr-xr-x 2 root root      0 Feb  2  2023  MSOCache
drwxrwxrwx 2 root root      0 Mar 15  2022  OneDriveTemp
drwxrwxrwx 2 root root      0 Sep  1  2021  PerfLogs
dr-xr-xr-x 2 root root      0 Feb  4 07:41 'Program Files'
drwxrwxrwx 2 root root      0 Feb  5 15:25 'Program Files (x86)'
drwxrwxrwx 2 root root      0 Feb  4 16:37  ProgramData
drwxrwxrwx 2 root root      0 Sep 27  2021  Python39
drwxrwxrwx 2 root root      0 Sep  1  2021  Recovery
drwxrwxrwx 2 root root      0 Feb  7 15:01 'System Volume Information'
dr-xr-xr-x 2 root root      0 Jan 30 06:49  Users
drwxrwxrwx 2 root root      0 Feb  2 09:43  Windows
-r-xr-xr-x 1 root root 384322 Jul 16  2016  bootmgr
drwxrwxrwx 2 root root      0 Dec  8 23:33  found.000
drwxrwxrwx 2 root root      0 Nov 25  2022  inetpub
drwxrwxrwx 2 root root      0 Jan  4 18:52  minikube
drwxrwxrwx 2 root root      0 Dec 15 06:14  tmp

问题是没有名为 的目录Afish。我可以在 Windows 中看到该目录。此外,我可以cd进入 docker 容器中的该目录并执行其他操作,例如lstouch

root@047daede994f:/mnt/c# cd Afish
root@047daede994f:/mnt/c/Afish#

dir /a在 Windows 上,结果如下:

c:\>dir C: /a
 Volume in drive C has no label.
 Volume Serial Number is E414-F089

 Directory of c:\

12/09/2023  10:17 AM    <DIR>          $Recycle.Bin
02/08/2024  02:14 PM    <DIR>          Afish
01/20/2024  07:19 PM    <DIR>          Afish2
02/26/2023  09:24 PM    <DIR>          Afish2_SSD
02/06/2024  03:25 PM    <DIR>          Afish3
02/18/2023  08:28 AM    <DIR>          Afish3_SSD
02/08/2024  11:25 AM    <DIR>          Afish5
01/01/2023  10:11 AM    <DIR>          Afish5_SSD
12/09/2023  10:49 AM    <DIR>          Afish6
12/09/2023  10:19 AM    <DIR>          Afish6_SSD
09/01/2021  06:42 AM    <DIR>          Afish_SSD
12/09/2023  10:58 AM    <DIR>          Afish_unencrypted
07/16/2016  02:18 PM           384,322 bootmgr
07/16/2016  02:18 PM                 1 BOOTNXT
09/01/2021  01:16 PM    <JUNCTION>     Documents and Settings [C:\Users]
12/09/2023  12:33 AM    <DIR>          found.000
11/25/2022  09:52 AM    <DIR>          inetpub
09/12/2016  12:35 PM    <DIR>          Logs
01/04/2024  07:52 PM    <DIR>          minikube
02/02/2023  05:29 PM    <DIR>          MSOCache
03/15/2022  12:58 PM    <DIR>          OneDriveTemp
09/01/2021  08:18 AM    <DIR>          PerfLogs
02/04/2024  08:41 AM    <DIR>          Program Files
02/05/2024  04:25 PM    <DIR>          Program Files (x86)
02/04/2024  05:37 PM    <DIR>          ProgramData
09/27/2021  01:17 PM    <DIR>          Python39
09/01/2021  01:16 PM    <DIR>          Recovery
02/07/2024  04:01 PM    <DIR>          System Volume Information
12/15/2023  07:14 AM    <DIR>          tmp
01/30/2024  07:49 AM    <DIR>          Users
02/02/2024  10:43 AM    <DIR>          Windows
               2 File(s)        384,323 bytes
              29 Dir(s)  50,478,219,264 bytes free

我不知道这是否重要,但目录Afish并由Afish_SSD当前用户使用 EFS 加密。Afish是一个常规目录(不是连接或符号链接)。

出了什么问题?为什么没有在 docker 中Afish列出?ls


列表C:\Afish

ls

root@047daede994f:/mnt/c/Afish# ls -al
total 24
drwxrwxrwx 2 root root 8192 Feb  8 13:14 .
drwxrwxrwx 2 root root 8192 Feb  5 15:25 ..
drwxrwxrwx 2 root root 4096 Dec 27 11:31 Dane
drwxrwxrwx 2 root root 4096 Feb  2 10:27 Dokumenty
drwxrwxrwx 2 root root    0 Dec  9 10:51 Duze_Dane
drwxrwxrwx 2 root root    0 Feb 18  2023 Pierdoly
drwxrwxrwx 2 root root    0 Dec 11 06:50 Projekty

dir

c:\Afish>dir /a
 Volume in drive C has no label.
 Volume Serial Number is E414-F089

 Directory of c:\Afish

02/08/2024  02:14 PM    <DIR>          .
02/08/2024  02:14 PM    <DIR>          ..
12/09/2023  11:56 AM    <JUNCTION>     Dane [C:\Users\afish\OneDrive\Dane]
12/09/2023  11:56 AM    <JUNCTION>     Dokumenty [C:\Users\afish\OneDrive\Dokumenty]
12/09/2023  11:51 AM    <DIR>          Duze_Dane
02/18/2023  07:46 PM    <DIR>          Pierdoly
12/11/2023  07:50 AM    <DIR>          Projekty
               0 File(s)              0 bytes
               7 Dir(s)  50,359,083,008 bytes free

相关内容