Windows 10 Docker 构建错误:“来自发件人的错误:打开 LogFiles\WMI\RtBackup:访问被拒绝。”

Zac*_*ack 5 windows powershell docker windows-10 dockerfile

我正在尝试在 64 位 Windows 10 控制台上为 Python 项目构建 Docker 映像。我安装了 Docker 版本 20.10.7,其中包含基于 WSL2 的引擎和 Ubuntu-18.04 集成。

Dockerfile结构如下:

FROM python:3.8.10

MAINTAINER 

WORKDIR ./VoiceRecognition

COPY ./ .


RUN pip install -r requirements.txt

COPY ./ .

ENTRYPOINT [ 'python3' ]

CMD [ 'VoiceRecognition/RunSpeakerIdentitification.py' ]
Run Code Online (Sandbox Code Playgroud)

我尝试在 Windows Powershell 中使用以下命令执行构建操作:

docker build -t voice-recognition:v1 -f ./VoiceRecognition/Dockerfile .

以管理员身份运行 Powershell 会出现以下错误:

=> ERROR [internal] load build context                                                                            3.1s
 => => transferring context: 114.79MB                                                                              3.1s
------
 > [internal] load build context:
------
error from sender: open LogFiles\WMI\RtBackup: Access is denied.
Run Code Online (Sandbox Code Playgroud)

我在论坛上搜索了潜在的解决方案,但所有相关问题的故障排除方法似乎都不起作用。我已按照此处的说明编辑了组权限,并尝试docker login在构建命令之前调用。此外,以非管理员身份运行 Powershell 会引发以下(不同的)错误:

=> ERROR [internal] load build context                                                                           47.6s
 => => transferring context: 1.42GB                                                                               47.6s
------
 > [internal] load build context:
------
error from sender: open AppData\Local\ElevatedDiagnostics: Access is denied.
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。谢谢。

小智 1

我刚才也遇到这个问题了。奇怪的是,当我将目录更改为上一级时,它就被修复了。