Use qt installer framework in a windows docker container
-
I am trying to build a container that has qt 5.15.1 and qt installer framework 4.1.1 installed. For this I have the following docker file:
# Use a machine from FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 # Set label LABEL maintainer="myemail@mydomain.com" # Add Qt5.15.1 ADD http://download.qt.io/development_releases/online_installers/qt-unified-windows-x86-4.0.0_beta-online.exe C:/qt-unified-windows-x86-4.0.0_beta-online.exe RUN qt-unified-windows-x86-4.0.0_beta-online.exe install qt.qt5.5151.win64_msvc2019_64 --email myemail@mydomain.com --pw mypass --accept-licenses --accept-obligations --auto-answer telemetry-question=No,AssociateCommonFiletypes=Yes --confirm-command --no-default-installations # Qt installer framework ADD https://download.qt.io/official_releases/qt-installer-framework/4.1.1/QtInstallerFramework-windows-x86-4.1.1.exe C:/QtInstallerFramework-windows-x86-4.1.1.exe RUN C:/QtInstallerFramework-windows-x86-4.1.1.exe in --al -c # Clean RUN del /Q "C:/QtInstallerFramework-windows-x86-4.1.1.exe"
You can generate the docker usin
docker build -f Dockerfile -t apalomer/qt:windows .
Be aware that to generate the image you need to change the email and password of theRUN qt-unified-windows...
command bysomething valid.This docker is build without a problem. However, when I start the container with
docker run -it apalomer/qt:windows
and try to run binarycrator, nothing happens. In the docker I runC:\Qt\QtIFW-4.1.1\bin\binarycreator.exe
which results with an exit code of-1073741515
(checked usingecho %errorlevel%
in the same terminal just after the binarycreator call). The same two commands run in a cmd of my computer (not inside the docker) show the help for the binarycreator and the error level is 1.Any idea on why can't I run binarycreator in the docker container?
ps: the docker container is being pushed to dockerhub if you want to try the container.
-
Hi,
Just an educated guess but it looks like a full Windows VS a minimal version for server use.
-
The thing that might be missing is the GUI part but it does not mean that it is something that can be detected easily. You might also want to use the offscreen backend so it might still be a viable solution.
-
I meant the Qt QPA backend named offscreen.
-
Exit code
When you execute one of QT IFW binaries in your servercore container, you can get the exit code in powershell.
Let's take repogen for example.
> .\repogen.exe > $LastExitCode -1073741515
It exits with code -1073741515.
The Microsoft Error Lookup Tool output STATUS_DLL_NOT_FOUND.Get missing dll
Thanks to DUMPBIN (that comes with MSVC Build Tools), you can see the DLLs needed for qt ifw binaries.
Mine was located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\dumpbin.exe.
dumpbin /DEPENDENTS C:\Qt\QtIFW-4.1.1\bin\repogen.exe
Note the results, you can then search for each DLL on your OS with this powershell cmd.
Get-ChildItem -Path C:\Windows\ -Filter dcomp.dll -Recurse -ErrorAction SilentlyContinue -Force
I found out that dcomp.dll was missing.
Indeed, we know Windows servercore is lacking GUI DLLs.Resolve
As it doesn't come in a package, you can copy it directly in your container.
Be careful to get a dll from Windows Server version matching your container (here 1809).Here the host was Windows Server 2019 Standard (1809).
Container was mcr.microsoft.com/windows/servercore:1809docker stop <image_name> docker cp C:\Windows\SysWOW64\dcomp.dll <image_name>:C:\Windows\SysWOW64\dcomp.dll
Now repogen is working.
Others QT IFW binaries seem to work fine too.Much better than the +10Go from a Windows 10 image. 😁
-
@Siriusval
Hi
19GB with multiple VS installed seems pretty good as normally I would hit
around 100 GB in a Vm.
What do you use for the GUI apps ? VNC or remote desktop ?
Or its ONLY compilers and ssh and commanline ? -
Hello @mrjj,
This image is only used for CI.
It's only command line, no GUI.
Even if you wanted to use VNC or remote desktop, I'm not sure you could.
The official windows/servercore docker image comes without the "Desktop Experience", so there's no GUI at all.
Hence our problem of missing graphic .DLLs like dcomp.Hope this helps 😁.
-
@apalomer said in Use qt installer framework in a windows docker container:
I have solved the issue myself. Although I do not understand why, everything works if I use
FROM mcr.microsoft.com/windows:20H2
instead ofFROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
.I tried that but got this error: (8007052E The user name or password is incorrect)