开发工具cli无法在Windows Container Docker中正常初始化
目前的场景是在基于Windows Container的环境中使用Docker打包开发环境以使用开发工具的cli功能。
但是当前稳定版本(1904090)和RC版本(1905151)均不能正常的安装、使用。
Dockerfile:
FROM mcr.microsoft.com/windows:1809SHELL ["powershell"]ENV tempDir=C:\\tempDirENV tempDevtool=${tempDir}\\devtool.exeRUN mkdir $env:tempDirENV devtoolDownloadLink=https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki&download_version=1021905081&version_type=1RUN (New-Object System.Net.WebClient).DownloadFile($env:devtoolDownloadLink, $env:tempDevtool)RUN Start-Process -FilePath $env:tempDevtool -ArgumentList '/S' -WaitRUN setx path '%PATH%;C:\\Program Files (x86)\\Tencent\\微信web开发者工具'RUN New-Item -Path "$env:LOCALAPPDATA\\微信开发者工具\\User` Data\\Default" -ItemType "directory"RUN New-Item -Path "$env:LOCALAPPDATA\\微信开发者工具\\User` Data\\Default\\.ide-status" -ItemType 'file' -Value 'On'ENTRYPOINT ["powershell"] |
在Container中运行症状如下:
安装程序未在$env:LOCALAPPDATA\\微信开发者工具\\中正确写入相关文件;
通过上文Dockerfile打包出的镜像执行cli,其创建的几个微信开发者工具.exe进程会立即结束,且命令行卡在
,同时经debug发现开发工具stuck在
。
