-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile-windows-servercore.template
40 lines (36 loc) · 1.33 KB
/
Dockerfile-windows-servercore.template
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
35
36
37
38
39
40
FROM mcr.microsoft.com/windows/{{ env.windowsVariant }}:{{ env.windowsRelease }}
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV JULIA_VERSION {{ .version }}
ENV JULIA_URL {{ .arches["windows-amd64"].url }}
ENV JULIA_SHA256 {{ .arches["windows-amd64"].sha256 }}
RUN Write-Host ('Downloading {0} ...' -f $env:JULIA_URL); \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -Uri $env:JULIA_URL -OutFile 'julia.exe'; \
\
Write-Host ('Verifying sha256 ({0}) ...' -f $env:JULIA_SHA256); \
if ((Get-FileHash julia.exe -Algorithm sha256).Hash -ne $env:JULIA_SHA256) { \
Write-Host 'FAILED!'; \
exit 1; \
}; \
\
Write-Host 'Installing ...'; \
Start-Process -Wait -NoNewWindow \
-FilePath '.\julia.exe' \
-ArgumentList @( \
'/SILENT', \
'/DIR=C:\julia' \
); \
\
Write-Host 'Removing ...'; \
Remove-Item julia.exe -Force; \
\
Write-Host 'Updating PATH ...'; \
$env:PATH = 'C:\julia\bin;' + $env:PATH; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
\
Write-Host 'Verifying install ("julia --version") ...'; \
julia --version; \
\
Write-Host 'Complete.'
CMD ["julia"]