Last active 1704379742

aly's Avatar aly revised this gist 1704379742. Go to revision

1 file changed, 24 insertions

Dockerfile(file created)

@@ -0,0 +1,24 @@
1 + FROM mcr.microsoft.com/windows/servercore:ltsc2022
2 +
3 + SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
4 +
5 + ENV JAVA_HOME "C:\Program Files\AdoptOpenJDK\jre-17.0.0.20-hotspot"
6 + RUN $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 +
11 + ENV JAVA_VERSION 17.0.0.20
12 + ENV 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 +
14 + RUN 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 +
24 + CMD ["powershell"]
Newer Older