41 lines
1.3 KiB
Docker
41 lines
1.3 KiB
Docker
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"]
|