File tree Expand file tree Collapse file tree 6 files changed +30
-0
lines changed
windowsservercore-ltsc2016
windowsservercore-ltsc2016 Expand file tree Collapse file tree 6 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,19 @@ FROM microsoft/nanoserver:sac2016
3
3
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4
4
SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
5
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\C urrentControlSet\C ontrol\S ecurityProviders\S CHANNEL\P rotocols\T LS 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
+
6
19
ENV JAVA_HOME C:\\ ojdkbuild
7
20
RUN $newPath = ('{0}\b in;{1}' -f $env:JAVA_HOME, $env:PATH); \
8
21
Write-Host ('Updating PATH: {0}' -f $newPath); \
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ ENV JAVA_OJDKBUILD_SHA256 7fcd9909173ed19f4ae6c0bba8b32b1e6bece2d49eb9d87271828b
17
17
18
18
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
19
19
Write-Host ('Downloading {0} ...' -f $url); \
20
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
20
21
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip' ; \
21
22
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
22
23
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ ENV JAVA_OJDKBUILD_SHA256 7fcd9909173ed19f4ae6c0bba8b32b1e6bece2d49eb9d87271828b
17
17
18
18
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
19
19
Write-Host ('Downloading {0} ...' -f $url); \
20
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
20
21
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip' ; \
21
22
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
22
23
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
Original file line number Diff line number Diff line change @@ -3,6 +3,19 @@ FROM microsoft/nanoserver:sac2016
3
3
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4
4
SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
5
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\C urrentControlSet\C ontrol\S ecurityProviders\S CHANNEL\P rotocols\T LS 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
+
6
19
ENV JAVA_HOME C:\\ ojdkbuild
7
20
RUN $newPath = ('{0}\b in;{1}' -f $env:JAVA_HOME, $env:PATH); \
8
21
Write-Host ('Updating PATH: {0}' -f $newPath); \
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ ENV JAVA_OJDKBUILD_SHA256 1333ab5bccc20e9043f0593b001825cbfa141f0e0c850d877af6b8
17
17
18
18
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
19
19
Write-Host ('Downloading {0} ...' -f $url); \
20
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
20
21
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip' ; \
21
22
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
22
23
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ ENV JAVA_OJDKBUILD_SHA256 1333ab5bccc20e9043f0593b001825cbfa141f0e0c850d877af6b8
17
17
18
18
RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
19
19
Write-Host ('Downloading {0} ...' -f $url); \
20
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
20
21
Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip' ; \
21
22
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
22
23
if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
You can’t perform that action at this time.
0 commit comments