-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.dockerfile
More file actions
92 lines (79 loc) · 4.96 KB
/
Copy pathdev.dockerfile
File metadata and controls
92 lines (79 loc) · 4.96 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# escape=`
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8.1-windowsservercore-ltsc2022
USER ContainerAdministrator
SHELL ["cmd", "/S", "/C"]
RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe `
&& (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
--add Microsoft.VisualStudio.Component.VC.CMake.Project `
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 `
--add Component.Microsoft.Windows.DriverKit.BuildTools `
--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest `
--remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
--remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
--remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
--remove Microsoft.VisualStudio.Component.Windows81SDK `
|| IF "%ERRORLEVEL%"=="3010" EXIT 0) `
&& del /q vs_buildtools.exe
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN $vs = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\2022\BuildTools'; `
$msvcRoot = Join-Path $vs 'VC\Tools\MSVC'; `
$msvcVersion = (Get-ChildItem $msvcRoot -Directory | Sort-Object Name -Descending | Select-Object -First 1).Name; `
$msvc = Join-Path $msvcRoot $msvcVersion; `
$sdkRoot = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10'; `
$sdkVersion = (Get-ChildItem (Join-Path $sdkRoot 'Include') -Directory | Sort-Object Name -Descending | Select-Object -First 1).Name; `
$extraPath = @( `
(Join-Path $msvc 'bin\Hostx64\x64'), `
(Join-Path $sdkRoot ('bin\' + $sdkVersion + '\x64')), `
(Join-Path $sdkRoot ('bin\' + $sdkVersion + '\x86')), `
(Join-Path $vs 'MSBuild\Current\Bin\amd64'), `
(Join-Path $vs 'Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin'), `
(Join-Path $vs 'Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja') `
); `
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine'); `
[Environment]::SetEnvironmentVariable('Path', (($extraPath + $machinePath) -join ';'), 'Machine'); `
[Environment]::SetEnvironmentVariable('INCLUDE', (( `
(Join-Path $msvc 'include'), `
(Join-Path $sdkRoot ('Include\' + $sdkVersion + '\ucrt')), `
(Join-Path $sdkRoot ('Include\' + $sdkVersion + '\um')), `
(Join-Path $sdkRoot ('Include\' + $sdkVersion + '\shared')), `
(Join-Path $sdkRoot ('Include\' + $sdkVersion + '\winrt')), `
(Join-Path $sdkRoot ('Include\' + $sdkVersion + '\cppwinrt')) `
) -join ';'), 'Machine'); `
[Environment]::SetEnvironmentVariable('LIB', (( `
(Join-Path $msvc 'lib\x64'), `
(Join-Path $sdkRoot ('Lib\' + $sdkVersion + '\ucrt\x64')), `
(Join-Path $sdkRoot ('Lib\' + $sdkVersion + '\um\x64')) `
) -join ';'), 'Machine'); `
[Environment]::SetEnvironmentVariable('LIBPATH', (Join-Path $msvc 'lib\x64'), 'Machine'); `
[Environment]::SetEnvironmentVariable('VCToolsInstallDir', ($msvc + '\'), 'Machine'); `
[Environment]::SetEnvironmentVariable('VSINSTALLDIR', ($vs + '\'), 'Machine'); `
[Environment]::SetEnvironmentVariable('WindowsSdkDir', ($sdkRoot + '\'), 'Machine'); `
[Environment]::SetEnvironmentVariable('WindowsSDKVersion', ($sdkVersion + '\'), 'Machine')
RUN Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
RUN Set-Service -Name sshd -StartupType 'Automatic'
RUN net user developer P@ssw0rd /add; `
net accounts /maxpwage:unlimited; `
net localgroup administrators developer /add
ADD https://nodejs.org/dist/v20.18.1/node-v20.18.1-x64.msi C:\TEMP\node-installer.msi
RUN Start-Process msiexec.exe -ArgumentList '/i', 'C:\TEMP\node-installer.msi', '/quiet', '/norestart' -NoNewWindow -Wait; `
Remove-Item C:\TEMP\node-installer.msi -Force
ARG CODEX_VERSION=0.123.0
RUN New-Item -ItemType Directory -Force C:\npm-global | Out-Null; `
npm config -g set prefix C:\npm-global; `
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine'); `
[Environment]::SetEnvironmentVariable('Path', ('C:\npm-global;' + $machinePath), 'Machine'); `
[Environment]::SetEnvironmentVariable('CODEX_HOME', 'C:\codex-home', 'Machine'); `
$env:Path = 'C:\npm-global;' + $machinePath + ';' + [Environment]::GetEnvironmentVariable('Path', 'User'); `
$codexPackage = '@openai/codex@' + $env:CODEX_VERSION; `
$codexNativePackage = '@openai/codex-win32-x64@npm:@openai/codex@' + $env:CODEX_VERSION + '-win32-x64'; `
npm install -g $codexPackage; `
npm install -g $codexNativePackage; `
npm install -g @google/gemini-cli; `
npm install -g @qwen-code/qwen-code@latest
RUN Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force
WORKDIR C:\workspace
EXPOSE 22
COPY start-dev.cmd C:\start-dev.cmd
CMD ["cmd", "/S", "/C", "C:\\start-dev.cmd"]