2017-10-06 80 views
0

我試圖使用Docker窗口更改捲上文件/文件夾的權限。但是,這些權限並沒有被意外更改。無法使用Docker窗口更改捲上文件/文件夾的權限

環境: 主持人:視窗10 Pro的 多克爾版本17.09.0策,建立afdb6d4

步驟重現:

  1. 構建圖像與下面的Dockerfile。
  2. 使用卷運行容器。
  3. 更改文件/文件夾的權限。

Dockerfile:

FROM microsoft/windowsservercore 
CMD [ "powershell" ] 

輸出:

D:\data\docker\sample>docker build -t sample . 
Sending build context to Docker daemon 1.272GB 
Step 1/2 : FROM microsoft/windowsservercore 
---> 2cddde20d95d 
Step 2/2 : CMD powershell 
---> Running in dd207fe8b262 
---> e0203df155cd 
Removing intermediate container dd207fe8b262 
Successfully built e0203df155cd 
Successfully tagged sample:latest 

D:\data\docker\sample>docker run -d --name sample --mount type=volume,source=sample_volume,target=C:/data sample ping -t localhost 
5a21f41d63de321e912ec3b99010a062d2e04d5f99145c6cd8bf649d3fbbebf1 

D:\data\docker\sample>docker exec -i sample cmd 
Microsoft Windows [Version 10.0.14393] 
(c) 2016 Microsoft Corporation. All rights reserved. 

C:\>cd c:\data 
cd c:\data 

c:\data>MKDIR foo 
MKDIR foo 

c:\data>ECHO hoge > foo\hoge.txt 
ECHO hoge > foo\hoge.txt 

c:\data>cacls foo 
cacls foo 
c:\data\foo NT AUTHORITY\SYSTEM:(OI)(CI)(ID)F 
      BUILTIN\Administrators:(OI)(CI)(ID)F 
      CREATOR OWNER:(OI)(CI)(IO)(ID)F 
      BUILTIN\Users:(OI)(CI)(ID)R 
      BUILTIN\Users:(CI)(ID)(special access:) 
            FILE_WRITE_DATA 
            FILE_APPEND_DATA 
            FILE_WRITE_EA 
            FILE_WRITE_ATTRIBUTES 



c:\data>cacls foo\hoge.txt 
cacls foo\hoge.txt 
c:\data\foo\hoge.txt NT AUTHORITY\SYSTEM:(ID)F 
        BUILTIN\Administrators:(ID)F 
        BUILTIN\Users:(ID)R 


c:\data>cacls foo /T /E /G everyone:F 
cacls foo /T /E /G everyone:F 
processed dir: c:\data\foo 
processed file: c:\data\foo\hoge.txt 

c:\data>cacls foo 
cacls foo 
c:\data\foo NT AUTHORITY\SYSTEM:(OI)(CI)(ID)F 
      BUILTIN\Administrators:(OI)(CI)(ID)F 
      CREATOR OWNER:(OI)(CI)(IO)(ID)F 
      BUILTIN\Users:(OI)(CI)(ID)R 
      BUILTIN\Users:(CI)(ID)(special access:) 
            FILE_WRITE_DATA 
            FILE_APPEND_DATA 
            FILE_WRITE_EA 
            FILE_WRITE_ATTRIBUTES 



c:\data>cacls foo\hoge.txt 
cacls foo\hoge.txt 
c:\data\foo\hoge.txt NT AUTHORITY\SYSTEM:(ID)F 
        BUILTIN\Administrators:(ID)F 
        BUILTIN\Users:(ID)R 

我發現了一個文件,該文件說,文件/文件夾的捲上的權限不能在Linux上的容器改變。但是我找不到有關Windows容器的文檔。 Windows容器是否支持Windows容器上卷上文件/文件夾的權限更改?

鏈接:

回答

1

從你提到的鏈接看來,docker for windows不支持更改文件權限。

泊塢的Windows currrently實現了基於 微軟SMB協議,該協議不支持細粒度的文件模式在這些權限 控制主機安裝卷。

+0

謝謝你的回答。我認爲這是Docker for Windows上Linux容器的情況。是否有關於Windows容器的文檔? – nodchip

+0

「Docker for windows」是指所有在windows平臺上運行的容器 – Ayushya

+0

我明白了。非常感謝! – nodchip