Skip to content

Commit 4016bc1

Browse files
authored
Merge pull request #200 from infosiftr/win10
Add ojdkbuild 10 builds
2 parents b182709 + f45f3f2 commit 4016bc1

File tree

5 files changed

+150
-2
lines changed

5 files changed

+150
-2
lines changed

.appveyor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ image: Visual Studio 2017
33

44
environment:
55
matrix:
6+
- version: 10
7+
variant: windowsservercore-ltsc2016
8+
- version: 10
9+
variant: nanoserver-sac2016
610
- version: 8
711
variant: windowsservercore-ltsc2016
812
- version: 8
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM microsoft/nanoserver:sac2016
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# enable TLS 1.2 (Nano Server doesn't support using "[Net.ServicePointManager]::SecurityProtocol")
7+
# https://docs.microsoft.com/en-us/system-center/vmm/install-tls?view=sc-vmm-1801
8+
# https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/operations/manage-ssl-protocols-in-ad-fs#enable-tls-12
9+
RUN Write-Host 'Enabling TLS 1.2 (https://githubengineering.com/crypto-removal-notice/) ...'; \
10+
$tls12RegBase = 'HKLM:\\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2'; \
11+
if (Test-Path $tls12RegBase) { throw ('"{0}" already exists!' -f $tls12RegBase) }; \
12+
New-Item -Path ('{0}/Client' -f $tls12RegBase) -Force; \
13+
New-Item -Path ('{0}/Server' -f $tls12RegBase) -Force; \
14+
New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \
15+
New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force; \
16+
New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \
17+
New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force
18+
19+
ENV JAVA_HOME C:\\ojdkbuild
20+
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
21+
Write-Host ('Updating PATH: {0}' -f $newPath); \
22+
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
23+
setx /M PATH $newPath;
24+
25+
# https://github.com/ojdkbuild/ojdkbuild/releases
26+
ENV JAVA_VERSION 10.0.1
27+
ENV JAVA_OJDKBUILD_VERSION 10.0.1-1
28+
ENV JAVA_OJDKBUILD_ZIP java-10-openjdk-10.0.1-1.b10.ojdkbuild.windows.x86_64.zip
29+
ENV JAVA_OJDKBUILD_SHA256 64664f2e28db55022d90beefd097779c59f843cacf1afeed8a7456ee64c603f1
30+
31+
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
32+
Write-Host ('Downloading {0} ...' -f $url); \
33+
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
34+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
35+
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
36+
Write-Host 'FAILED!'; \
37+
exit 1; \
38+
}; \
39+
\
40+
Write-Host 'Expanding ...'; \
41+
Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
42+
\
43+
Write-Host 'Renaming ...'; \
44+
Move-Item \
45+
-Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
46+
-Destination $env:JAVA_HOME \
47+
; \
48+
\
49+
Write-Host 'Verifying install ...'; \
50+
Write-Host ' java -version'; java -version; \
51+
Write-Host ' javac -version'; javac -version; \
52+
\
53+
Write-Host 'Removing ...'; \
54+
Remove-Item ojdkbuild.zip -Force; \
55+
\
56+
Write-Host 'Complete.';
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM microsoft/windowsservercore:1709
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
ENV JAVA_HOME C:\\ojdkbuild
7+
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
8+
Write-Host ('Updating PATH: {0}' -f $newPath); \
9+
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
10+
setx /M PATH $newPath;
11+
12+
# https://github.com/ojdkbuild/ojdkbuild/releases
13+
ENV JAVA_VERSION 10.0.1
14+
ENV JAVA_OJDKBUILD_VERSION 10.0.1-1
15+
ENV JAVA_OJDKBUILD_ZIP java-10-openjdk-10.0.1-1.b10.ojdkbuild.windows.x86_64.zip
16+
ENV JAVA_OJDKBUILD_SHA256 64664f2e28db55022d90beefd097779c59f843cacf1afeed8a7456ee64c603f1
17+
18+
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
19+
Write-Host ('Downloading {0} ...' -f $url); \
20+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
21+
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
22+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
23+
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
24+
Write-Host 'FAILED!'; \
25+
exit 1; \
26+
}; \
27+
\
28+
Write-Host 'Expanding ...'; \
29+
Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
30+
\
31+
Write-Host 'Renaming ...'; \
32+
Move-Item \
33+
-Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
34+
-Destination $env:JAVA_HOME \
35+
; \
36+
\
37+
Write-Host 'Verifying install ...'; \
38+
Write-Host ' java -version'; java -version; \
39+
Write-Host ' javac -version'; javac -version; \
40+
\
41+
Write-Host 'Removing ...'; \
42+
Remove-Item ojdkbuild.zip -Force; \
43+
\
44+
Write-Host 'Complete.';
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM microsoft/windowsservercore:ltsc2016
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
ENV JAVA_HOME C:\\ojdkbuild
7+
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
8+
Write-Host ('Updating PATH: {0}' -f $newPath); \
9+
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
10+
setx /M PATH $newPath;
11+
12+
# https://github.com/ojdkbuild/ojdkbuild/releases
13+
ENV JAVA_VERSION 10.0.1
14+
ENV JAVA_OJDKBUILD_VERSION 10.0.1-1
15+
ENV JAVA_OJDKBUILD_ZIP java-10-openjdk-10.0.1-1.b10.ojdkbuild.windows.x86_64.zip
16+
ENV JAVA_OJDKBUILD_SHA256 64664f2e28db55022d90beefd097779c59f843cacf1afeed8a7456ee64c603f1
17+
18+
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
19+
Write-Host ('Downloading {0} ...' -f $url); \
20+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
21+
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
22+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
23+
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
24+
Write-Host 'FAILED!'; \
25+
exit 1; \
26+
}; \
27+
\
28+
Write-Host 'Expanding ...'; \
29+
Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
30+
\
31+
Write-Host 'Renaming ...'; \
32+
Move-Item \
33+
-Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
34+
-Destination $env:JAVA_HOME \
35+
; \
36+
\
37+
Write-Host 'Verifying install ...'; \
38+
Write-Host ' java -version'; java -version; \
39+
Write-Host ' javac -version'; javac -version; \
40+
\
41+
Write-Host 'Removing ...'; \
42+
Remove-Item ojdkbuild.zip -Force; \
43+
\
44+
Write-Host 'Complete.';

update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ EOD
409409
elif [[ "$ojdkbuildVersion" == 1.* ]]; then
410410
# convert "1.8.0.111-3" into "8u111"
411411
ojdkJavaVersion="$(echo "$ojdkbuildVersion" | cut -d. -f2,4 | cut -d- -f1 | tr . u)"
412-
elif [[ "$ojdkbuildVersion" == 9.* ]]; then
413-
# convert "9.0.1-1.b01" into "9.0.1"
412+
elif [[ "$ojdkbuildVersion" == 10.* ]]; then
413+
# convert "10.0.1-1.b10" into "10.0.1"
414414
ojdkJavaVersion="${ojdkbuildVersion%%-*}"
415415
else
416416
echo >&2 "error: unable to parse ojdkbuild version $ojdkbuildVersion"

0 commit comments

Comments
 (0)