dev
windows 68 lines 3.33 KB
Raw
1 # Usage:
2 # docker build . -f Dockerfile.windows -t ghcr.io/cake-tech/cake_wallet:main-windows
3 # docker push ghcr.io/cake-tech/cake_wallet:main-windows
4
5 FROM mcr.microsoft.com/windows/servercore:ltsc2022
6
7 ENV FLUTTER_VERSION=3.27.4
8 ENV GIT_VERSION=2.47.1
9 ENV VS_INSTALLED_DIR="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
10 ENV PATH="C:\Users\ContainerAdministrator\.cargo\bin;C:\ProgramData\chocolatey\bin;C:\flutter\flutter\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps"
11 ENV RUNNER_VERSION=2.321.0
12 ENV RUNNER_URL=https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-win-x64-${RUNNER_VERSION}.zip
13 ENV RUNNER_WORKDIR=_work
14
15 RUN powershell -Command \
16 curl.exe -L https://aka.ms/vs/17/release/vc_redist.x64.exe -o vc_redist.x64.exe ; \
17 Start-Process -Wait -FilePath .\vc_redist.x64.exe -ArgumentList '/quiet', '/install' ; \
18 Remove-Item -Force vc_redist.x64.exe
19
20 RUN powershell -Command \
21 $GIT_VERSION = [Environment]::GetEnvironmentVariable('GIT_VERSION'); \
22 curl.exe -L https://github.com/git-for-windows/git/releases/download/v$($GIT_VERSION).windows.1/Git-$($GIT_VERSION)-64-bit.exe -o git_installer.exe ; \
23 Start-Process -Wait -FilePath .\git_installer.exe -ArgumentList '/SILENT', '/NOICONS' ; \
24 Remove-Item -Force git_installer.exe
25
26 RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
27 Set-ExecutionPolicy RemoteSigned -Scope Process; \
28 [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \
29 Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicP -OutFile install.ps1; \
30 powershell -NoProfile -ExecutionPolicy Bypass -File install.ps1; \
31 Remove-Item -Force install.ps1
32
33 RUN choco install -y visualstudio2022community
34 RUN choco install -y visualstudio2022-workload-nativedesktop
35 RUN choco install -y nodejs
36 RUN choco install -y go
37 RUN choco install -y 7zip
38
39 RUN powershell -Command \
40 curl.exe -L https://win.rustup.rs -o rustup-init.exe; \
41 Start-Process -Wait -FilePath .\rustup-init.exe -ArgumentList "-y"; \
42 Remove-Item -Force .\rustup-init.exe
43
44 RUN powershell -Command \
45 curl.exe -L https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -o C:\Windows\System32\nuget.exe
46
47 RUN powershell -Command \
48 $FLUTTER_VERSION = [Environment]::GetEnvironmentVariable('FLUTTER_VERSION'); \
49 curl.exe -L https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_$($FLUTTER_VERSION)-stable.zip -o flutter.zip ; \
50 7z x flutter.zip -oC:\flutter -bsp1 -bse1 ; \
51 Remove-Item -Force flutter.zip
52
53 RUN flutter precache
54
55 WORKDIR C:\\actions-runner
56
57 RUN powershell -Command \
58 curl.exe -L $env:RUNNER_URL -o 'actions-runner.zip'; \
59 7z x actions-runner.zip -oC:\actions-runner -bsp1 -bse1 ; \
60 Remove-Item -Path 'actions-runner.zip'
61
62 COPY actions-runner/.credentials /actions-runner/.credentials
63 COPY actions-runner/.credentials_rsaparams /actions-runner/.credentials_rsaparams
64 COPY actions-runner/.runner /actions-runner/.runner
65
66 COPY ci_entrypoint.ps1 /actions-runner/ci_entrypoint.ps1
67
68 ENTRYPOINT ["powershell", "-File", "ci_entrypoint.ps1"]