-
Notifications
You must be signed in to change notification settings - Fork 179
/
Dockerfile.windows
26 lines (18 loc) · 1.59 KB
/
Dockerfile.windows
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
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["powershell", "-Command"]
WORKDIR C:\\app\\
ENV PYTHON_VERSION=3.11.6
RUN Invoke-WebRequest -Uri "https://www.python.org/ftp/python/$Env:PYTHON_VERSION/python-$Env:PYTHON_VERSION-amd64.exe" -OutFile "C:\\python-installer.exe" -UseBasicParsing; \
$gitRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/git-for-windows/git/releases/latest" -Headers @{ 'User-Agent' = 'Docker Build' }; \
$gitInstallerUrl = $gitRelease.assets | Where-Object { $_.name -like '*64-bit.exe' } | Select-Object -ExpandProperty browser_download_url; \
Invoke-WebRequest -Uri $gitInstallerUrl -OutFile "C:\\git-installer.exe" -UseBasicParsing;
RUN Start-Process -FilePath "C:\\python-installer.exe" -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 TargetDir=C:\\Python' -Wait; \
Start-Process -FilePath "C:\\git-installer.exe" -ArgumentList '/VERYSILENT /NORESTART /SP-' -Wait; \
Remove-Item -Force "C:\\python-installer.exe", "C:\\git-installer.exe"; \
if (!(Test-Path 'C:\\Python')) { throw 'Python installation failed!' }; \
$env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine)
RUN $latestRelease = (Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/lisa/releases/latest").tag_name; \
git clone --depth 1 --branch $latestRelease https://github.com/microsoft/lisa.git C:\\app\\lisa
WORKDIR C:\\app\\lisa
RUN python -m pip install --no-cache-dir --upgrade pip; \
python -m pip install --no-cache-dir --editable .[ado,azure,libvirt,baremetal] --config-settings editable_mode=compat