Docker Community Forums

Share and learn in the Docker community.

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 the RUN 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 run C:\Qt\QtIFW-4.1.1\bin\binarycreator.exe which results with an exit code of -1073741515 (checked using echo %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.

I have solved the issue myself. Although I do not understand why, everything works if I use FROM mcr.microsoft.com/windows:20H2 instead of FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019.

### 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:1809


docker 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. :grin:

1 Like