|
| 1 | +FROM mcr.microsoft.com/windows/servercore:ltsc2019 |
| 2 | + |
| 3 | +# Add OpenGL DLLs from a Windows desktop to allow running unit tests within the container |
| 4 | +ADD *.dll C:/Windows/System32/ |
| 5 | + |
| 6 | +# Install Microsoft Visual C++ Redistributable for Visual Studio 2015-2022 |
| 7 | +ARG VCREDIST_URL="https://download.visualstudio.microsoft.com/download/pr/6ba404bb-6312-403e-83be-04b062914c98/1AD7988C17663CC742B01BEF1A6DF2ED1741173009579AD50A94434E54F56073/VC_redist.x64.exe" |
| 8 | +RUN powershell -Command Invoke-WebRequest $env:VCREDIST_URL -OutFile 'C:/tmp.exe' -UseBasicParsing ; \ |
| 9 | + && C:/tmp.exe /quiet /norestart \ |
| 10 | + && del C:\tmp.exe |
| 11 | + |
| 12 | +# Install 7-Zip |
| 13 | +ARG 7ZIP_URL="https://7-zip.org/a/7z2301-x64.exe" |
| 14 | +RUN powershell -Command Invoke-WebRequest $env:7ZIP_URL -OutFile 'C:/tmp.exe' -UseBasicParsing ; \ |
| 15 | + && C:/tmp.exe /S /D="C:/7zip" \ |
| 16 | + && setx PATH "%PATH%;C:\7zip" \ |
| 17 | + && del C:\tmp.exe |
| 18 | + |
| 19 | +# Install Git |
| 20 | +ARG GIT_URL="https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/Git-2.44.0-64-bit.exe" |
| 21 | +RUN powershell -Command Invoke-WebRequest $env:GIT_URL -OutFile 'C:/tmp.exe' -UseBasicParsing ; \ |
| 22 | + && C:/tmp.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS \ |
| 23 | + /COMPONENTS="gitlfs" /o:PathOption="CmdTools" /o:CRLFOption="LFOnly" \ |
| 24 | + && del C:\tmp.exe |
| 25 | + |
| 26 | +# Install Python |
| 27 | +# - Set PIP_BREAK_SYSTEM_PACKAGES to allow installing pip packages system-wide |
| 28 | +# since there's no risk in a container |
| 29 | +# - Put Python user site in PATH to allow installing packages with --user |
| 30 | +ARG PYTHON_URL="https://www.python.org/ftp/python/3.12.2/python-3.12.2-amd64.exe" |
| 31 | +RUN powershell -Command Invoke-WebRequest $env:PYTHON_URL -OutFile 'C:/tmp.exe' -UseBasicParsing ; \ |
| 32 | + && C:/tmp.exe /quiet InstallAllUsers=1 PrependPath=1 Include_doc=0 Include_tcltk=0 TargetDir="C:\python" \ |
| 33 | + && setx PYTHONIOENCODING "UTF-8" \ |
| 34 | + && setx PIP_BREAK_SYSTEM_PACKAGES 1 \ |
| 35 | + && cmd /c "FOR /F %i IN ('C:\python\python.exe -m site --user-base') DO setx PATH "%PATH%;%i\bin"" \ |
| 36 | + && del C:\tmp.exe |
| 37 | + |
| 38 | +# Install CMake |
| 39 | +ARG CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-windows-x86_64.zip" |
| 40 | +RUN powershell -Command Invoke-WebRequest $env:CMAKE_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 41 | + && 7z x C:/tmp.7z -oC:/ -bsp1 \ |
| 42 | + && rename cmake-3.28.3-windows-x86_64 cmake \ |
| 43 | + && setx PATH "%PATH%;C:\cmake\bin" \ |
| 44 | + && del C:\tmp.7z |
| 45 | + |
| 46 | +# Install Ninja |
| 47 | +ARG NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip" |
| 48 | +RUN powershell -Command Invoke-WebRequest $env:NINJA_URL -OutFile 'C:/tmp.zip' -UseBasicParsing ; \ |
| 49 | + && 7z x C:/tmp.zip -oC:/ninja -bsp1 \ |
| 50 | + && setx PATH "%PATH%;C:\ninja" \ |
| 51 | + && del C:\tmp.zip |
| 52 | + |
| 53 | +# Install CCache |
| 54 | +ARG CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip" |
| 55 | +RUN powershell -Command Invoke-WebRequest $env:CCACHE_URL -OutFile 'C:/tmp.zip' -UseBasicParsing ; \ |
| 56 | + && 7z x C:/tmp.zip -oC:/ -bsp1 \ |
| 57 | + && rename ccache-4.9.1-windows-x86_64 ccache \ |
| 58 | + && setx PATH "%PATH%;C:\ccache" \ |
| 59 | + && del C:\tmp.zip |
| 60 | + |
| 61 | +# Install MinGW |
| 62 | +ARG MINGW_URL="https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_mingw90/qt.tools.win64_mingw900/9.0.0-1-202203221220mingw-w64-x86_64-11.2.0-release-posix-seh-rt_v9-rev3.7z" |
| 63 | +RUN powershell -Command Invoke-WebRequest $env:MINGW_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 64 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 65 | + && setx PATH "%PATH%;C:\Qt\Tools\mingw1120_64\bin" \ |
| 66 | + && del C:\tmp.7z |
| 67 | + |
| 68 | +# Install ZLib |
| 69 | +ARG ZLIB_VERSION="1.3.1" |
| 70 | +ARG ZLIB_URL="https://github.com/madler/zlib/releases/download/v$ZLIB_VERSION/zlib131.zip" |
| 71 | +RUN powershell -Command Invoke-WebRequest $env:ZLIB_URL -OutFile 'C:/tmp.zip' -UseBasicParsing ; \ |
| 72 | + && 7z x C:/tmp.zip -oC:/ -bsp1 \ |
| 73 | + && cd C:/zlib-%ZLIB_VERSION% \ |
| 74 | + && cmake . -G "Ninja" -DCMAKE_INSTALL_PREFIX=C:/zlib \ |
| 75 | + && ninja \ |
| 76 | + && ninja install \ |
| 77 | + && setx ZLIB_ROOT "C:/zlib" \ |
| 78 | + && setx PATH "%PATH%;C:\zlib\bin" \ |
| 79 | + && cd .. \ |
| 80 | + && rmdir C:\zlib-%ZLIB_VERSION% /s /q \ |
| 81 | + && del C:\tmp.zip |
| 82 | + |
| 83 | +# Install OpenCascade |
| 84 | +ARG OCC_VERSION="7_7_2" |
| 85 | +ARG OCC_URL="https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V$OCC_VERSION.zip" |
| 86 | +RUN powershell -Command Invoke-WebRequest $env:OCC_URL -OutFile 'C:/tmp.zip' -UseBasicParsing ; \ |
| 87 | + && 7z x C:/tmp.zip -oC:/ -bsp1 \ |
| 88 | + && cd C:\OCCT-%OCC_VERSION% \ |
| 89 | + && cmake . -G "Ninja" \ |
| 90 | + -DCMAKE_BUILD_TYPE=Release \ |
| 91 | + -DINSTALL_DIR=C:/OpenCascade \ |
| 92 | + -DBUILD_LIBRARY_TYPE=Shared \ |
| 93 | + -DBUILD_MODULE_ApplicationFramework=0 \ |
| 94 | + -DBUILD_MODULE_DataExchange=1 \ |
| 95 | + -DBUILD_MODULE_Draw=0 \ |
| 96 | + -DBUILD_MODULE_FoundationClasses=0 \ |
| 97 | + -DBUILD_MODULE_ModelingAlgorithms=0 \ |
| 98 | + -DBUILD_MODULE_ModelingData=0 \ |
| 99 | + -DBUILD_MODULE_Visualization=0 \ |
| 100 | + -DUSE_DRACO=0 \ |
| 101 | + -DUSE_FREEIMAGE=0 \ |
| 102 | + -DUSE_FREETYPE=0 \ |
| 103 | + -DUSE_GLES2=0 \ |
| 104 | + -DUSE_OPENGL=0 \ |
| 105 | + -DUSE_OPENVR=0 \ |
| 106 | + -DUSE_RAPIDJSON=0 \ |
| 107 | + -DUSE_TBB=0 \ |
| 108 | + -DUSE_TK=0 \ |
| 109 | + -DUSE_VTK=0 \ |
| 110 | + && cmake --build . \ |
| 111 | + && cmake --install . \ |
| 112 | + && setx OpenCASCADE_DIR C:/OpenCascade/cmake \ |
| 113 | + && setx PATH "%PATH%;C:\OpenCascade\win64\gcc\bin" \ |
| 114 | + && cd .. \ |
| 115 | + && rmdir C:\OCCT-%OCC_VERSION% /s /q \ |
| 116 | + && del C:\tmp.zip |
| 117 | + |
| 118 | +# Install Qt whatever DLLs |
| 119 | +ARG QT_VERSION="6.6.2" |
| 120 | +ARG QT_BASEURL="https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_662" |
| 121 | +ARG QT_URL="${QT_BASEURL}/qt.qt6.662.win64_mingw/6.6.2-0-202402121135" |
| 122 | +ARG QT_DLLS_URL="${QT_URL}MinGW-w64-x86_64-11.2.0-release-posix-seh-rt_v9-rev1-runtime.7z" |
| 123 | +RUN powershell -Command Invoke-WebRequest $env:QT_DLLS_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 124 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 125 | + && del C:\tmp.7z |
| 126 | + |
| 127 | +# Install Qt Tools |
| 128 | +ARG QT_TOOLS_URL="${QT_URL}qttools-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 129 | +RUN powershell -Command Invoke-WebRequest $env:QT_TOOLS_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 130 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 131 | + && setx PATH "%PATH%;C:\Qt\%QT_VERSION%\mingw_64\bin" \ |
| 132 | + && del C:\tmp.7z |
| 133 | + |
| 134 | +# Install Qt Base |
| 135 | +ARG QT_BASE_URL="${QT_URL}qtbase-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 136 | +ARG QT_PRI="C:\\Qt\\$QT_VERSION\\mingw_64\\mkspecs\\qconfig.pri" |
| 137 | +RUN powershell -Command Invoke-WebRequest $env:QT_BASE_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 138 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 139 | + && del C:\tmp.7z \ |
| 140 | + && powershell -Command "((Get-Content -path $env:QT_PRI -Raw) -replace 'Enterprise', 'OpenSource') | Set-Content -Path $env:QT_PRI" \ |
| 141 | + && powershell -Command "((Get-Content -path $env:QT_PRI -Raw) -replace 'licheck.exe', '') | Set-Content -Path $env:QT_PRI" |
| 142 | + |
| 143 | +# Install Qt SVG |
| 144 | +ARG QT_SVG_URL="${QT_URL}qtsvg-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 145 | +RUN powershell -Command Invoke-WebRequest $env:QT_SVG_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 146 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 147 | + && del C:\tmp.7z |
| 148 | + |
| 149 | +# Install Qt Declarative |
| 150 | +ARG QT_DECLARATIVE_URL="${QT_URL}qtdeclarative-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 151 | +RUN powershell -Command Invoke-WebRequest $env:QT_DECLARATIVE_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 152 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 153 | + && del C:\tmp.7z |
| 154 | + |
| 155 | +# Install Qt OpenGL (not sure if needed) |
| 156 | +ARG QT_QT5OPENGL_URL="${QT_URL}opengl32sw-64-mesa_11_2_2-signed_sha256.7z" |
| 157 | +RUN powershell -Command Invoke-WebRequest $env:QT_QT5OPENGL_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 158 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 159 | + && del C:\tmp.7z |
| 160 | + |
| 161 | +# Install Qt D3D (not sure if needed) |
| 162 | +ARG QT_QT5D3D_URL="${QT_URL}d3dcompiler_47-x64.7z" |
| 163 | +RUN powershell -Command Invoke-WebRequest $env:QT_QT5D3D_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 164 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 165 | + && del C:\tmp.7z |
| 166 | + |
| 167 | +# Install Qt Translations |
| 168 | +ARG QT_TRANSLATIONS_URL="${QT_URL}qttranslations-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 169 | +RUN powershell -Command Invoke-WebRequest $env:QT_TRANSLATIONS_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 170 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 171 | + && del C:\tmp.7z |
| 172 | + |
| 173 | +# Install Qt5 Compat |
| 174 | +ARG QT_QT5COMPAT_URL="${QT_BASEURL}/qt.qt6.662.qt5compat.win64_mingw/6.6.2-0-202402121135qt5compat-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 175 | +RUN powershell -Command Invoke-WebRequest $env:QT_QT5COMPAT_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 176 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 177 | + && del C:\tmp.7z |
| 178 | + |
| 179 | +# Install Qt Image Formats Plugin |
| 180 | +ARG QT_IMAGEFORMATS_URL="${QT_BASEURL}/qt.qt6.662.addons.qtimageformats.win64_mingw/6.6.2-0-202402121135qtimageformats-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z" |
| 181 | +RUN powershell -Command Invoke-WebRequest $env:QT_IMAGEFORMATS_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 182 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 183 | + && del C:\tmp.7z |
| 184 | + |
| 185 | +# Install Inno Setup |
| 186 | +ARG INNOSETUP_URL="https://files.jrsoftware.org/is/6/innosetup-6.2.2.exe" |
| 187 | +RUN powershell -Command Invoke-WebRequest $env:INNOSETUP_URL -OutFile 'C:/tmp.exe' -UseBasicParsing ; \ |
| 188 | + && C:/tmp.exe /NOICONS /VERYSILENT /DIR=C:\innosetup \ |
| 189 | + && setx PATH "%PATH%;C:\innosetup" \ |
| 190 | + && del C:\tmp.exe |
| 191 | + |
| 192 | +# Install OpenSSL (last one in Dockerfile because it should be updated regularly) |
| 193 | +ARG OPENSSL_URL="https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_opensslv3_x64/qt.tools.opensslv3.win_x64/3.0.12-1openssl_3.0.12_prebuild_x64.7z" |
| 194 | +RUN powershell -Command Invoke-WebRequest $env:OPENSSL_URL -OutFile 'C:/tmp.7z' -UseBasicParsing ; \ |
| 195 | + && 7z x C:/tmp.7z -oC:/Qt -bsp1 \ |
| 196 | + && setx OPENSSL_ROOT "C:/Qt/Tools/OpenSSLv3/Win_x64" \ |
| 197 | + && del C:\tmp.7z |
0 commit comments