-
-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathservercore.Dockerfile.j2
34 lines (29 loc) · 1.37 KB
/
servercore.Dockerfile.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{% include 'partials/license.j2' %}
FROM {{ base_image }}
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
{% include 'partials/java-version.j2' %}
RUN Write-Host ('Downloading {{ arch_data.download_url }} ...'); \
curl.exe -LfsSo openjdk.msi {{ arch_data.download_url }} ; \
Write-Host ('Verifying sha256 ({{ arch_data.checksum }}) ...'); \
if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '{{ arch_data.checksum }}') { \
Write-Host 'FAILED!'; \
exit 1; \
}; \
\
New-Item -ItemType Directory -Path C:\temp | Out-Null; \
\
Write-Host 'Installing using MSI ...'; \
$proc = Start-Process -FilePath "msiexec.exe" -ArgumentList '/i', 'openjdk.msi', '/L*V', 'C:\temp\OpenJDK.log', \
'/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\openjdk-{{ version }}' -Wait -Passthru; \
$proc.WaitForExit() ; \
if ($proc.ExitCode -ne 0) { \
Write-Host 'FAILED installing MSI!' ; \
exit 1; \
}; \
\
Remove-Item -Path C:\temp -Recurse | Out-Null; \
Write-Host 'Removing openjdk.msi ...'; \
Remove-Item openjdk.msi -Force
{% include 'partials/version-check-windows.j2' %}
{% include 'partials/jshell.j2' %}