Last active 1704379742

Dockerfile Raw
1FROM mcr.microsoft.com/windows/servercore:ltsc2022
2
3SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4
5ENV JAVA_HOME "C:\Program Files\AdoptOpenJDK\jre-17.0.0.20-hotspot"
6RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
7 Write-Host ('Updating PATH: {0}' -f $newPath); \
8 setx /M PATH $newPath; \
9 Write-Host 'Complete.'
10
11ENV JAVA_VERSION 17.0.0.20
12ENV JAVA_URL https://github.com/AdoptOpenJDK/openjdk17-binaries/releases/download/jdk-2021-05-07-13-31/OpenJDK-jre_x64_windows_hotspot_2021-05-06-23-30.msi
13
14RUN Write-Host ('Downloading {0} ...' -f $env:JAVA_URL); \
15 (new-object System.Net.WebClient).Downloadfile("$env:JAVA_URL", 'C:\jre.msi'); \
16 Start-Process 'C:\jre.msi' '/qn /norestart /L*V "C:\jre.msi.log"' -PassThru | Wait-Process; \
17 Remove-Item -Path 'C:\jre.msi'; \
18 \
19 Write-Host 'Verifying install ...'; \
20 Write-Host ' java --version'; java --version; \
21 \
22 Write-Host 'Complete.'
23
24CMD ["powershell"]
25