无法在 Windows 2019 中的 dockerfile 中使用 FontReg.exe 注册字体

问题描述 投票:0回答:1

我无法在 Windows 2019 机器上的 dockerfile 中运行此 fontreg.exe

我正在使用 Start-Process .\FontReg.exe 运行

Start-Process .\FontReg.exe -wait

它没有给出错误,但字体注册没有发生。

However it works on writing it inside I’m CMD[“powershell.exe”, “Start-Process C:\FontReg.exe”] Or  ENTRYPOINT[powershell.exe”,”Start-Process C:\FontReg.exe] 
我不想使用 CMD 和入口点

不确定这是否是由于权限原因 我已向文件添加了完全访问控制,甚至尝试使用 containerAdministrator 运行

然而,在 Windows 11 dockerfile 中运行它时,它工作得很好

很奇怪为什么 Windows 2019 会发生这种情况

我对比了docker版本 两个系统都有相同的 docker 版本

请帮忙,我被困住了

我正在使用 Start-Process .\FontReg.exe 运行

Start-Process .\FontReg.exe -wait

windows docker fonts containers
1个回答
0
投票

我看起来您正在尝试在 CMD shell 中运行 PowerShell 命令。

尝试一下:

RUN FontReg.exe

或使用

SHELL
指令切换外壳:

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Start-Process .\FontReg.exe -wait
© www.soinside.com 2019 - 2024. All rights reserved.