Better MAUI Windows Docker Image #22230
-
I'm trying to create a slimmer docker image on windows. I would prefer windows as I can build for android, iOS, windows, macos (not maui I know), and maccatalyst. The problem is the only success I have had is to download the Visual Studio Build Tools and install all the necessary packages. Docker file looks like this:
And this TECHNICALLY works, but the problem is it comes in at 27GB, and anytime I want to update, it takes hours. I have attempted a slimmer version, by using the official dotnet images, but I can't figure out a way to install the android sdk in a way dotnet will find it; I keep getting "Android SDK not found" errors no matter where I put it. I have seen successful Linux docker images for Android, but I wish to stick with windows so that can compile my nuget project with just the "dotnet pack" command; as far as I can tell, windows is the only platform this will work on. And I can't use Github actions as I'm using a local Gitlab server. Most annoyingly, I can't just run this directly on the build machine because the path length becomes too long for android >:(. Any plan for an official MAUI docker image? and if not, has anybody successfully made a slightly slimmer docker image for MAUI on windows that can compile android? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I am looking for this as well. Have you made any progress on this? |
Beta Was this translation helpful? Give feedback.
-
This one comes in at 11.9 GB and works to build my .Net 8 Android Maui project.
|
Beta Was this translation helpful? Give feedback.
-
I also have a repo here: https://github.com/Redth/maui-docker which builds a couple docker images.
Going to be adding a basic CI/CD type image that has no GitHub actions runner but installs everything you need to build still. |
Beta Was this translation helpful? Give feedback.
This one comes in at 11.9 GB and works to build my .Net 8 Android Maui project.