Skip to content

Add ojdkbuild 10 builds #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ image: Visual Studio 2017

environment:
matrix:
- version: 10
variant: windowsservercore-ltsc2016
- version: 10
variant: nanoserver-sac2016
- version: 8
variant: windowsservercore-ltsc2016
- version: 8
Expand Down
56 changes: 56 additions & 0 deletions 10/jdk/windows/nanoserver-sac2016/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM microsoft/nanoserver:sac2016

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# enable TLS 1.2 (Nano Server doesn't support using "[Net.ServicePointManager]::SecurityProtocol")
# https://docs.microsoft.com/en-us/system-center/vmm/install-tls?view=sc-vmm-1801
# https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/operations/manage-ssl-protocols-in-ad-fs#enable-tls-12
RUN Write-Host 'Enabling TLS 1.2 (https://githubengineering.com/crypto-removal-notice/) ...'; \
$tls12RegBase = 'HKLM:\\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2'; \
if (Test-Path $tls12RegBase) { throw ('"{0}" already exists!' -f $tls12RegBase) }; \
New-Item -Path ('{0}/Client' -f $tls12RegBase) -Force; \
New-Item -Path ('{0}/Server' -f $tls12RegBase) -Force; \
New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \
New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force; \
New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \
New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force

ENV JAVA_HOME C:\\ojdkbuild
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
Write-Host ('Updating PATH: {0}' -f $newPath); \
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
setx /M PATH $newPath;

# https://github.com/ojdkbuild/ojdkbuild/releases
ENV JAVA_VERSION 10.0.1
ENV JAVA_OJDKBUILD_VERSION 10.0.1-1
ENV JAVA_OJDKBUILD_ZIP java-10-openjdk-10.0.1-1.b10.ojdkbuild.windows.x86_64.zip
ENV JAVA_OJDKBUILD_SHA256 64664f2e28db55022d90beefd097779c59f843cacf1afeed8a7456ee64c603f1

RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
Write-Host ('Downloading {0} ...' -f $url); \
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
Write-Host 'FAILED!'; \
exit 1; \
}; \
\
Write-Host 'Expanding ...'; \
Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
\
Write-Host 'Renaming ...'; \
Move-Item \
-Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
-Destination $env:JAVA_HOME \
; \
\
Write-Host 'Verifying install ...'; \
Write-Host ' java -version'; java -version; \
Write-Host ' javac -version'; javac -version; \
\
Write-Host 'Removing ...'; \
Remove-Item ojdkbuild.zip -Force; \
\
Write-Host 'Complete.';
44 changes: 44 additions & 0 deletions 10/jdk/windows/windowsservercore-1709/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM microsoft/windowsservercore:1709

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV JAVA_HOME C:\\ojdkbuild
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
Write-Host ('Updating PATH: {0}' -f $newPath); \
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
setx /M PATH $newPath;

# https://github.com/ojdkbuild/ojdkbuild/releases
ENV JAVA_VERSION 10.0.1
ENV JAVA_OJDKBUILD_VERSION 10.0.1-1
ENV JAVA_OJDKBUILD_ZIP java-10-openjdk-10.0.1-1.b10.ojdkbuild.windows.x86_64.zip
ENV JAVA_OJDKBUILD_SHA256 64664f2e28db55022d90beefd097779c59f843cacf1afeed8a7456ee64c603f1

RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
Write-Host ('Downloading {0} ...' -f $url); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
Write-Host 'FAILED!'; \
exit 1; \
}; \
\
Write-Host 'Expanding ...'; \
Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
\
Write-Host 'Renaming ...'; \
Move-Item \
-Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
-Destination $env:JAVA_HOME \
; \
\
Write-Host 'Verifying install ...'; \
Write-Host ' java -version'; java -version; \
Write-Host ' javac -version'; javac -version; \
\
Write-Host 'Removing ...'; \
Remove-Item ojdkbuild.zip -Force; \
\
Write-Host 'Complete.';
44 changes: 44 additions & 0 deletions 10/jdk/windows/windowsservercore-ltsc2016/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM microsoft/windowsservercore:ltsc2016

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV JAVA_HOME C:\\ojdkbuild
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
Write-Host ('Updating PATH: {0}' -f $newPath); \
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
setx /M PATH $newPath;

# https://github.com/ojdkbuild/ojdkbuild/releases
ENV JAVA_VERSION 10.0.1
ENV JAVA_OJDKBUILD_VERSION 10.0.1-1
ENV JAVA_OJDKBUILD_ZIP java-10-openjdk-10.0.1-1.b10.ojdkbuild.windows.x86_64.zip
ENV JAVA_OJDKBUILD_SHA256 64664f2e28db55022d90beefd097779c59f843cacf1afeed8a7456ee64c603f1

RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
Write-Host ('Downloading {0} ...' -f $url); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
Write-Host 'FAILED!'; \
exit 1; \
}; \
\
Write-Host 'Expanding ...'; \
Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
\
Write-Host 'Renaming ...'; \
Move-Item \
-Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
-Destination $env:JAVA_HOME \
; \
\
Write-Host 'Verifying install ...'; \
Write-Host ' java -version'; java -version; \
Write-Host ' javac -version'; javac -version; \
\
Write-Host 'Removing ...'; \
Remove-Item ojdkbuild.zip -Force; \
\
Write-Host 'Complete.';
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ EOD
elif [[ "$ojdkbuildVersion" == 1.* ]]; then
# convert "1.8.0.111-3" into "8u111"
ojdkJavaVersion="$(echo "$ojdkbuildVersion" | cut -d. -f2,4 | cut -d- -f1 | tr . u)"
elif [[ "$ojdkbuildVersion" == 9.* ]]; then
# convert "9.0.1-1.b01" into "9.0.1"
elif [[ "$ojdkbuildVersion" == 10.* ]]; then
# convert "10.0.1-1.b10" into "10.0.1"
ojdkJavaVersion="${ojdkbuildVersion%%-*}"
else
echo >&2 "error: unable to parse ojdkbuild version $ojdkbuildVersion"
Expand Down