Dockerfile_windows_10 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Dockerfile for installing the necessary dependencies for building Hadoop.
  17. # See BUILDING.txt.
  18. FROM mcr.microsoft.com/windows:ltsc2019
  19. # Need to disable the progress bar for speeding up the downloads.
  20. # hadolint ignore=SC2086
  21. RUN powershell $Global:ProgressPreference = 'SilentlyContinue'
  22. # Restore the default Windows shell for correct batch processing.
  23. SHELL ["cmd", "/S", "/C"]
  24. # Install Visual Studio 2019 Build Tools.
  25. RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe \
  26. && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache \
  27. --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" \
  28. --add Microsoft.VisualStudio.Workload.VCTools \
  29. --add Microsoft.VisualStudio.Component.VC.ASAN \
  30. --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
  31. --add Microsoft.VisualStudio.Component.Windows10SDK.19041 \
  32. || IF "%ERRORLEVEL%"=="3010" EXIT 0) \
  33. && del /q vs_buildtools.exe
  34. # Install Chocolatey.
  35. RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
  36. RUN setx PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  37. # Install git.
  38. RUN choco install git.install -y
  39. RUN powershell Copy-Item -Recurse -Path 'C:\Program Files\Git' -Destination C:\Git
  40. # Install vcpkg.
  41. # hadolint ignore=DL3003
  42. RUN powershell git clone https://github.com/microsoft/vcpkg.git \
  43. && cd vcpkg \
  44. && git checkout 7ffa425e1db8b0c3edf9c50f2f3a0f25a324541d \
  45. && .\bootstrap-vcpkg.bat
  46. RUN powershell .\vcpkg\vcpkg.exe install boost:x64-windows
  47. RUN powershell .\vcpkg\vcpkg.exe install protobuf:x64-windows
  48. RUN powershell .\vcpkg\vcpkg.exe install openssl:x64-windows
  49. RUN powershell .\vcpkg\vcpkg.exe install zlib:x64-windows
  50. ENV PROTOBUF_HOME "C:\vcpkg\installed\x64-windows"
  51. # Install Azul Java 8 JDK.
  52. RUN powershell Invoke-WebRequest -URI https://cdn.azul.com/zulu/bin/zulu8.62.0.19-ca-jdk8.0.332-win_x64.zip -OutFile $Env:TEMP\zulu8.62.0.19-ca-jdk8.0.332-win_x64.zip
  53. RUN powershell Expand-Archive -Path $Env:TEMP\zulu8.62.0.19-ca-jdk8.0.332-win_x64.zip -DestinationPath "C:\Java"
  54. ENV JAVA_HOME "C:\Java\zulu8.62.0.19-ca-jdk8.0.332-win_x64"
  55. RUN setx PATH "%PATH%;%JAVA_HOME%\bin"
  56. # Install Apache Maven.
  57. RUN powershell Invoke-WebRequest -URI https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip -OutFile $Env:TEMP\apache-maven-3.8.6-bin.zip
  58. RUN powershell Expand-Archive -Path $Env:TEMP\apache-maven-3.8.6-bin.zip -DestinationPath "C:\Maven"
  59. RUN setx PATH "%PATH%;C:\Maven\apache-maven-3.8.6\bin"
  60. ENV MAVEN_OPTS '-Xmx2048M -Xss128M'
  61. # Install CMake 3.19.0.
  62. RUN powershell Invoke-WebRequest -URI https://cmake.org/files/v3.19/cmake-3.19.0-win64-x64.zip -OutFile $Env:TEMP\cmake-3.19.0-win64-x64.zip
  63. RUN powershell Expand-Archive -Path $Env:TEMP\cmake-3.19.0-win64-x64.zip -DestinationPath "C:\CMake"
  64. RUN setx PATH "%PATH%;C:\CMake\cmake-3.19.0-win64-x64\bin"
  65. # Install zstd 1.5.4.
  66. RUN powershell Invoke-WebRequest -Uri https://github.com/facebook/zstd/releases/download/v1.5.4/zstd-v1.5.4-win64.zip -OutFile $Env:TEMP\zstd-v1.5.4-win64.zip
  67. RUN powershell Expand-Archive -Path $Env:TEMP\zstd-v1.5.4-win64.zip -DestinationPath "C:\ZStd"
  68. RUN setx PATH "%PATH%;C:\ZStd"
  69. # Install libopenssl 3.1.0 needed for rsync 3.2.7.
  70. RUN powershell Invoke-WebRequest -Uri https://repo.msys2.org/msys/x86_64/libopenssl-3.1.0-1-x86_64.pkg.tar.zst -OutFile $Env:TEMP\libopenssl-3.1.0-1-x86_64.pkg.tar.zst
  71. RUN powershell zstd -d $Env:TEMP\libopenssl-3.1.0-1-x86_64.pkg.tar.zst -o $Env:TEMP\libopenssl-3.1.0-1-x86_64.pkg.tar
  72. RUN powershell mkdir "C:\LibOpenSSL"
  73. RUN powershell tar -xvf $Env:TEMP\libopenssl-3.1.0-1-x86_64.pkg.tar -C "C:\LibOpenSSL"
  74. # Install libxxhash 0.8.1 needed for rsync 3.2.7.
  75. RUN powershell Invoke-WebRequest -Uri https://repo.msys2.org/msys/x86_64/libxxhash-0.8.1-1-x86_64.pkg.tar.zst -OutFile $Env:TEMP\libxxhash-0.8.1-1-x86_64.pkg.tar.zst
  76. RUN powershell zstd -d $Env:TEMP\libxxhash-0.8.1-1-x86_64.pkg.tar.zst -o $Env:TEMP\libxxhash-0.8.1-1-x86_64.pkg.tar
  77. RUN powershell mkdir "C:\LibXXHash"
  78. RUN powershell tar -xvf $Env:TEMP\libxxhash-0.8.1-1-x86_64.pkg.tar -C "C:\LibXXHash"
  79. # Install libzstd 1.5.4 needed for rsync 3.2.7.
  80. RUN powershell Invoke-WebRequest -Uri https://repo.msys2.org/msys/x86_64/libzstd-1.5.4-1-x86_64.pkg.tar.zst -OutFile $Env:TEMP\libzstd-1.5.4-1-x86_64.pkg.tar.zst
  81. RUN powershell zstd -d $Env:TEMP\libzstd-1.5.4-1-x86_64.pkg.tar.zst -o $Env:TEMP\libzstd-1.5.4-1-x86_64.pkg.tar
  82. RUN powershell mkdir "C:\LibZStd"
  83. RUN powershell tar -xvf $Env:TEMP\libzstd-1.5.4-1-x86_64.pkg.tar -C "C:\LibZStd"
  84. # Install rsync 3.2.7.
  85. RUN powershell Invoke-WebRequest -Uri https://repo.msys2.org/msys/x86_64/rsync-3.2.7-2-x86_64.pkg.tar.zst -OutFile $Env:TEMP\rsync-3.2.7-2-x86_64.pkg.tar.zst
  86. RUN powershell zstd -d $Env:TEMP\rsync-3.2.7-2-x86_64.pkg.tar.zst -o $Env:TEMP\rsync-3.2.7-2-x86_64.pkg.tar
  87. RUN powershell mkdir "C:\RSync"
  88. RUN powershell tar -xvf $Env:TEMP\rsync-3.2.7-2-x86_64.pkg.tar -C "C:\RSync"
  89. # Copy the dependencies of rsync 3.2.7.
  90. RUN powershell Copy-Item -Path "C:\LibOpenSSL\usr\bin\*.dll" -Destination "C:\Program` Files\Git\usr\bin"
  91. RUN powershell Copy-Item -Path "C:\LibXXHash\usr\bin\*.dll" -Destination "C:\Program` Files\Git\usr\bin"
  92. RUN powershell Copy-Item -Path "C:\LibZStd\usr\bin\*.dll" -Destination "C:\Program` Files\Git\usr\bin"
  93. RUN powershell Copy-Item -Path "C:\RSync\usr\bin\*" -Destination "C:\Program` Files\Git\usr\bin"
  94. # We get strange Javadoc errors without this.
  95. RUN setx classpath ""
  96. RUN git config --global core.longpaths true
  97. RUN setx PATH "%PATH%;C:\Program Files\Git\usr\bin"
  98. # Define the entry point for the docker container.
  99. ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&", "cmd.exe"]