Dockerfile 1.62 KB
Newer Older
Eric Timmons's avatar
Eric Timmons committed
1
2
# escape=`

Eric Timmons's avatar
Eric Timmons committed
3
FROM mcr.microsoft.com/windows/servercore:1809
Eric Timmons's avatar
Eric Timmons committed
4
5
6
7
8
9

# Switch to powershell and make sure it exits on error
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV CCL_VERSION=1.12

Eric Timmons's avatar
Eric Timmons committed
10
RUN $srcurl = ('https://github.com/Clozure/ccl/releases/download/v{0}/ccl-{0}-windowsx86.zip' -f $env:CCL_VERSION); `
11
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
Eric Timmons's avatar
Eric Timmons committed
12
13
14
15
    Write-Host ('Downloading {0}' -f $srcurl); `
    Invoke-WebRequest -Uri $srcurl -OutFile ccl.zip -UserAgent "NativeHost"; `
    Write-Host 'Done downloading'; `
    $expectedsha256 = 'F1BA6CFF353F6E6E13828F41DC92A723C01766AE38DCFF774905C9E02D59ED04'; `
Eric Timmons's avatar
Eric Timmons committed
16
    $actualsha256 = (Get-FileHash ccl.zip -Algorithm sha256).Hash; `
Eric Timmons's avatar
Eric Timmons committed
17
18
19
20
21
22
23
24
25
    Write-Host ('Verifying sha256 {0} (expected: {1})' -f $actualsha256, $expectedsha256); `
    if ($actualsha256 -ne $expectedsha256) { `
        Write-Host 'SHA256 check FAILED!'; `
        exit 1; `
    }; `
    Expand-Archive -Force C:\ccl.zip 'C:\Program Files\'; `
    rm C:\ccl.zip; `
    Add-Content -Path 'C:\Program Files\ccl\ccl.cmd' -Value '@echo off'; `
    Add-Content -Path 'C:\Program Files\ccl\ccl.cmd' '\"C:\Program Files\ccl\wx86cl64.exe\"'; `
Eric Timmons's avatar
Eric Timmons committed
26
27
    type 'C:\Program Files\ccl\ccl.cmd'

28
RUN $machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\', $true); `
29
    $machinePath = $machineKey.GetValue('PATH', [string]::Empty, 'DoNotExpandEnvironmentNames').ToString(); `
30
    $newPath = ('C:\Program Files\ccl;{0}' -f $machinePath); `
31
    $machineKey.SetValue('PATH', $newPath, 'ExpandString'); `
Eric Timmons's avatar
Eric Timmons committed
32
    $machineKey.Close();
Eric Timmons's avatar
Eric Timmons committed
33
34

CMD ["ccl"]