diff --git a/desktop/README.md b/desktop/README.md new file mode 100644 index 0000000..23295fa --- /dev/null +++ b/desktop/README.md @@ -0,0 +1,10 @@ +# Docker containers for performing Flutter desktop builds + +These docker containers are built on containers from [cirrusci](https://hub.docker.com/u/cirrusci) ([cirruslabs](https://github.com/cirruslabs)). + +- linux-dev is just cirrusci/flutter:dev + apt installing the needed utils +- windows-dev-sdk30-fdev2.2rc is cirrusci/android-sdk:30-windowsservercore-2019 with Visual Studio 16, and Flutter dev (2.2rc) + +These docker containers are both being used with Drone CI to build Flutter desktop apps for Linux and Windows. Simply run `flutter build` with the appropriate OS. These containers should work with any other Docker based automated build system such as Gitlab and others. + +Example [.drone.yml](https://git.openprivacy.ca/flutter/flutter_app/src/branch/trunk/.drone.yml) diff --git a/desktop/linux/Dockerfile b/desktop/linux/Dockerfile new file mode 100644 index 0000000..971be64 --- /dev/null +++ b/desktop/linux/Dockerfile @@ -0,0 +1,5 @@ +FROM cirrusci/flutter:dev + +RUN apt-get update +RUN apt-get install -y --no-install-recommends cmake ninja-build clang build-essential pkg-config libgtk-3-dev liblzma-dev lcov +RUN flutter config --enable-linux-desktop diff --git a/desktop/windows/Dockerfile b/desktop/windows/Dockerfile new file mode 100644 index 0000000..abc2540 --- /dev/null +++ b/desktop/windows/Dockerfile @@ -0,0 +1,41 @@ +FROM cirrusci/android-sdk:30-windowsservercore-2019 + +# Install VS +## https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019 + +## Restore the default Windows shell for correct batch processing. +SHELL ["cmd", "/S", "/C"] + +## Download the Build Tools bootstrapper. +ADD https://aka.ms/vs/16/release/channel C:/TEMP/VisualStudio.chman + +ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:/TEMP/vs_buildtools.exe +## https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019 +RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache \ + --channelUri C:\TEMP\VisualStudio.chman \ + --installChannelUri C:\TEMP\VisualStudio.chman \ + --add Microsoft.VisualStudio.Component.Windows10SDK.19041 \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --add Microsoft.VisualStudio.Component.VC.CMake.Project \ + --add Microsoft.VisualStudio.Workload.NativeDesktop \ + --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.CLI.Support \ + --installPath C:\BuildTools \ + || IF "%ERRORLEVEL%"=="3010" EXIT 0 + +# Install Flutter + +RUN setx path "%path%;C:\flutter\bin;C:\flutter\bin\cache\dart-sdk\bin;" + +RUN git clone --branch dev https://github.com/flutter/flutter.git C:\flutter + +RUN flutter config --no-analytics + +RUN flutter config --enable-windows-desktop + +## Fix android sdk licenses (missing in cirruslabs container) +RUN powershell.exe -Command \ + Set-Content -Value "`n859f317696f67ef3d7f30a50a5560e7834b43903" -Path C:\Android\licenses\android-sdk-arm-dbt-license + +RUN flutter doctor -v