# Using server works when the host is Windows Server 2022, using (the default) process isolation (and is fast) # or server works when the host is Windows 11 using (the default) hyperv isolation (but is really slow). #FROM mcr.microsoft.com/windows/server:ltsc2022 AS vs2022 # servercore doesn't have dcomp.dll that we need for qsb.exe when compiling Qt, however we can copy dcomp.dll from the host. FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS vs2022 COPY dcomp.dll /windows/system32/ # note, this must be the host's version of the dll or we get an unknown signal call error (at least when the host is Windows 11 and using the dcomp.dll from server). # this allows us to use process isolation with a Windows 11 host, which is fast. # to use servercore copy dcomp.dll from C:\Windows\System32\dcomp.dll into context directory before building. RUN reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v Disabled /t REG_DWORD /d 1 /f RUN reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting" /v DontShowUI /t REG_DWORD /d 1 /f ADD https://aka.ms/vs/17/release/vs_professional.exe temp/ RUN ["powershell", "Start-Process", "-FilePath", "temp/vs_Professional.exe", "-ArgumentList", "\"--quiet --wait --norestart --noUpdateInstaller --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.ATL --add Microsoft.VisualStudio.Component.Windows11SDK.22621\"", "-Wait"] # Opt out of Visual Studio Customer Experience Improvement Program RUN reg add "HKLM\SOFTWARE\Microsoft\Wow6432Node\Microsoft\VSCommon\17.0" /v SQM /t REG_DWORD /d 0 /f RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \ $Env:chocolateyVersion = '0.10.15' ; \ $Env:chocolateyUseWindowsCompression = 'false' ; \ "[Net.ServicePointManager]::SecurityProtocol = \"tls12, tls11, tls\"; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" FROM vs2022 AS qt ADD https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe temp/ RUN temp\qt-unified-windows-x64-online.exe in -m jonathan.brady@denbridgemarine.com --pw vQ5C%DIMsH@WzES4 --na qt.tools.openssl.win_x64 qt.tools.cmake qt.tools.ninja qt.tools.ifw.46 --aa telemetry-question=No --al --nf --nd --da -c \ && C:\Qt\MaintenanceTool.exe up --na -m jonathan.brady@denbridgemarine.com --pw vQ5C%DIMsH@WzES4 --al --nf --nd -c || echo "Success" FROM qt AS compile RUN choco install -y python --version 3.11 \ && choco install -y strawberryperl \ && choco install -y nodejs \ && choco install -y gperf \ && choco install -y winflexbison RUN python -m pip install --upgrade pip \ && pip install html5lib WORKDIR Qt CMD ["cmd"] ## To create container: # docker build . -t qt ## 20GB default storage is not enough, need around 250GB to compile QtWebEngine # docker run -it --storage-opt size=250G --isolation=process --name qt qt ## Inside container: # "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat" # set PATH=C:\Qt\Tools\CMake_64\bin;C:\Qt\Tools\Ninja;%PATH% # C:\Qt\MaintenanceTool.exe in --na qt.qt6.652.src -m jonathan.brady@denbridgemarine.com --pw vQ5C%DIMsH@WzES4 --al --nf --nd -c # cd 6.5.2\Src # configure.bat -prefix C:/Qt/6.5.2/msvc2022_64 -debug-and-release -force-debug-info -nomake tests -opengl dynamic -nomake examples -openssl -no-sql-mysql -plugin-sql-sqlite -plugin-sql-odbc -no-sql-psql -qt-zlib -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qthttpserver -skip qtimageformats -skip qtinsighttracker -skip qtlanguageserver -skip qtlocation -skip qtlottie -skip qtmqtt -skip qtmultimedia -skip qtnetworkauth -skip qtopcua -skip qtpositioning -skip qtserialport -skip qtsvg -skip qtquick3d -skip qtquick3dphysics -skip qtquickeffectmaker -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtspeech -skip qtvirtualkeyboard -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -- -DOPENSSL_ROOT_DIR="C:\Qt\Tools\OpenSSL\Win_x64" # cmake --build . --parallel