1
+ # escape=`
2
+
3
+ ARG BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022-amd64
4
+
5
+ FROM ${BASE_IMAGE}
6
+
7
+ SHELL ["cmd" , "/S" , "/C" ]
8
+
9
+ ENV GIT_VERSION=2.43.0
10
+ ENV GIT_GODBOLT_REPOSITORY_PATH=C:\c ompiler-explorer
11
+ ENV CE_URL=https://github.com/Devsh-Graphics-Programming/compiler-explorer.git
12
+ ENV CE_SHA=ce980aded514ae6a0a1b1f63e7fb358e57c9ed57
13
+ ENV NODEJS_MSI=https://nodejs.org/dist/v18.19.0/node-v18.19.0-x64.msi
14
+
15
+ RUN `
16
+ # Install Chocolatey
17
+ `
18
+ powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
19
+
20
+ RUN `
21
+ # Install Git
22
+ `
23
+ choco install -y git --version %GIT_VERSION%
24
+
25
+ RUN `
26
+ # Install Node LTS
27
+ `
28
+ curl -SL --output nodejs.msi %NODEJS_MSI% `
29
+ `
30
+ && msiexec /i nodejs.msi /qn `
31
+ `
32
+ && del /q nodejs.msi
33
+
34
+ RUN `
35
+ # Checkout Compiler-Explorer
36
+ `
37
+ mkdir %GIT_GODBOLT_REPOSITORY_PATH% `
38
+ `
39
+ && git -C %GIT_GODBOLT_REPOSITORY_PATH% init `
40
+ `
41
+ && git -C %GIT_GODBOLT_REPOSITORY_PATH% remote add origin %CE_URL% `
42
+ `
43
+ && git -C %GIT_GODBOLT_REPOSITORY_PATH% fetch --depth=1 -- origin %CE_SHA% `
44
+ `
45
+ && git -C %GIT_GODBOLT_REPOSITORY_PATH% checkout %CE_SHA% `
46
+ `
47
+ && setx GIT_GODBOLT_REPOSITORY_PATH %GIT_GODBOLT_REPOSITORY_PATH% /M
48
+
49
+ RUN `
50
+ # Install node depenendencies
51
+ `
52
+ cd %GIT_GODBOLT_REPOSITORY_PATH% `
53
+ `
54
+ && npm install
55
+
56
+ RUN `
57
+ # Post git configuration, trust containers
58
+ `
59
+ git config --system --add safe.directory * `
60
+ `
61
+ # Enable Long Paths feature
62
+ `
63
+ && reg add "HKLM\S YSTEM\C urrentControlSet\C ontrol\F ileSystem" /v "LongPathsEnabled" /t REG_DWORD /d 1 /f
0 commit comments