mirror of
https://github.com/gmeligio/flutter-docker-image.git
synced 2026-05-24 12:30:34 +00:00
008cce50a1
- Extends the manifest-first discipline (already used for Flutter/Android) to the Windows toolchain. `config/version.json` now carries `windows.git`, `windows.vsBuildTools.cmakeProject`, `windows.vsBuildTools.windows11Sdk.build`, and `windows.vsBuildTools.vcTools`; `config/schema.cue` validates them via new `#SemverQuad` and `#WindowsToolchain` definitions. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: verified-commit[bot] <180343340+verified-commit[bot]@users.noreply.github.com>
6.5 KiB
6.5 KiB
Windows
Swich between Linux and Windows containers
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon
Toolchain versions
Windows toolchain versions (Git for Windows, Visual Studio BuildTools components, Windows 11 SDK build) are pinned in config/version.json under the windows block and validated by config/schema.cue. The update_version.yml workflow refreshes these alongside Flutter and Android in the monthly upgrade PR, and the Pester suite asserts the installed image matches the manifest on every CI run.
TODO
- Install tools
# # needed? No
# --add Microsoft.Component.MSBuild' `
# # needed? No
# --add Microsoft.VisualStudio.Component.TestTools.BuildTools `
# # needed? No
# --add Microsoft.VisualStudio.Component.VC.ASAN `
# # needed? no
# # --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
RUN Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile vs_BuildTools.exe; `
Start-Process vs_BuildTools.exe -ArgumentList '--quiet --wait --norestart --nocache `
# # needed? yes
# --add Microsoft.VisualStudio.Component.VC.CMake.Project `
# # needed? Yes
# --add Microsoft.VisualStudio.Component.Windows11SDK.22621 `
# # needed?
# --add Microsoft.VisualStudio.Workload.VCTools' `
-Wait; `
Remove-Item vs_BuildTools.exe;
- Read dependencies from flutter_tools.
- Check how it can be run in Github actions.
- Check how it can be run in Gitlab CI/CD.
- Test that path to powershell.exe exists.
- Test that Build Tools were installed in C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\msbuild\current\bin
- Check Windows installation requirements for Flutter
- Add docs explaining to use
$VerbosePreference = 'Continue';in the SHELL to debug unexpected pwsh problems.
Open issue in windows Docker images repo
- Some images can be pulled while others give error:
Error response from daemon: Get "https://mcr.microsoft.com/v2/": read tcp [2a0c:5a84:e100:e501::a97c]:58039->[2603:1061:f:101::10]:443: wsarecv: An existing connection was forcibly closed by the remote host.
Debug with curl -A github165 -v https://mcr.microsoft.com/v2/powershell/manifests/lts-nanoserver-ltsc2022
Contribute flutter upstream
- Remove
WHEREin bin\internal\shared.bat and use instead:
pwsh.exe -Command "exit" >nul 2>&1 && (
SET powershell_executable=pwsh.exe
) || powershell.exe -Command "exit" >nul 2>&1 && (
SET powershell_executable=PowerShell.exe
) || (
ECHO Error: PowerShell executable not found. 1>&2
ECHO Either pwsh.exe or PowerShell.exe must be in your PATH. 1>&2
EXIT 1
)
- Find if the executable should be pwsh or powershell and put it in a service to remove the hardcoded "powershell" in multiple places, like in:
- dev\devicelab\lib\framework\running_processes.dart
- packages\flutter_tools\lib\src\windows\windows_version_validator.dart
Steps to reproduce in Docker
- Enable Windows Developer Settings to solve error:
# >Building with plugins requires symlink support.
# >
# >Please enable Developer Mode in your system settings. Run
# > start ms-settings:developers
# >to open settings.
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
- For CI/CD
- Docker version must be pinned in Github workflow to avoid breaking changes: with escaping
\"syntax inside RUN directive, etc. - Packaging tool in Windows: msix . It uses the executables:
- makeappx.exe
- makepri.exe
- signtool.exe
- certificate
* Make a note that --install-certificate should be "false" or configured because the certificate can't be installed as ContainerUser.
# OK Import-PfxCertificate -FilePath "C:\Users\ContainerUser\AppData\Local\Pub\Cache\hosted\pub.dev\msix-3.16.8\lib\assets\test_certificate.pfx" -Password (ConvertTo-SecureString -AsPlainText -Force "1234") -CertStoreLocation Cert:\LocalMachine\Root # Doesn't work Import-PfxCertificate -FilePath "C:\Users\ContainerUser\AppData\Local\Pub\Cache\hosted\pub.dev\msix-3.16.8\lib\assets\test_certificate.pfx" -Password (ConvertTo-SecureString -AsPlainText -Force "1234") - Install msstore CLI https://github.com/microsoft/msstore-cli It seems behind StoreBroker but it looks that it's going to be the primary and recommended way to publish to Microsoft Store
- According to the msstore guide, It will be needed to install Microsoft.NetCore.Component.Runtime.8.0 with vs_BuildTools
- From github.com/tauu/flutter-windows-builder/Dockerfile => install github.com/microsoft/StoreBroker This is currently the primary tool to publish to Microsoft Store
- Not installed right now
- Install the Windows App Certification Kit or the Windows SDK that already includes it
- Installed currently by one of the workloads in vs_BuildTools
- Docker version must be pinned in Github workflow to avoid breaking changes: with escaping