Skip to content

About

Docker container for MAUI Android builds

Resources

Stars

17 stars

Watchers

2 watching

Forks

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker image .NET MAUI Android

Builds a docker image that allows containerised builds of .NET 11.0 MAUI Android 37.2 apps.

The goal of the resulting image is that you can run dotnet build on a MAUI Android workspace without first needing to install additional software.

Basic approach

  • Start the docker image. It's recommended to do so from a .NET major.minor version tag, (e.g. :11.0) and not latest.
  • Get the source code you want to build
  • dotnet build

Minimal example of steps in Github Actions

steps:
  - name: Checkout
    uses: actions/checkout@v4
  - name: Build
    shell: bash
    run: dotnet build
  - name: Upload AAB
    uses: actions/upload-artifact@v4
    with:
      name: aab
      path: bin/Release/net11.0-android/com.example.app-Signed.aab
      if-no-files-found: error
      retention-days: 1

Building

There are two possible approaches:

  • Sort of copy your current development machine configuration into a docker image
  • Create a docker image based on a specifically configured set of versions that is not present on your local system

Copy local versions

If your current machine is set-up to build .NET‌ MAUI Android apps, and you want a docker image with similar capabilities:

  1. Clone this repo

  2. Create a .env file where you set:

      MAINTAINER="Your (company) name"
      DOCKER_HUB_USERNAME=your-dockerhub-username
  3. Run ./build.sh

  4. Test the image

  5. Run ./build.sh -p to push the image to your docker hub. It will be tagged with latest, the exact .NET SDK Version and the overarching .NET SDK major.minor version.

Manually choose versions

  1. Clone this repo

  2. Create a .env file where you set the versions you want:

      MAINTAINER="Your (company) name"
      DOCKER_HUB_USERNAME=your-dockerhub-username
      # Change the versions below to whatever you want.
      SDK_VERSION=11.0.100
      ANDROID_API=37.2
      BUILD_TOOLS_VERSION=37.0.0
      # Optional: This is the default. JDK 21 is also supported.
      # JAVA_VERSION=25
  3. Run ./build.sh

  4. Test the image

  5. Run ./build.sh -p to push the image to your docker hub. It will be tagged with latest, the exact .NET SDK Version and the overarching .NET SDK major.minor version.

About

Docker container for MAUI Android builds

Resources

Stars

17 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages