windowsdockerqtdockerfileqt-installer

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.


Solution

  • 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.