1
0
James Ketrenos bf80f5e5ec Initial version
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00
2024-12-10 17:51:59 -08:00

Android Development Container

This sets up development containers for Expo and Flutter using the Android SDK. The Dockerfile is derived from parts of thyrlian/android-sdk, with expo and flutter development infrastructure configured as well.

Build the Android SDK base container

This will seed the base container with an initial version of the Android SDK.

docker compose build

This will build the base 'android-sdk-manager' container as well as the unseeded 'android-dev-container'.

Inside the 'anrdoid-sdk-manager' container the directory '/sdk' will contain the original SDK.

After it is created, the SDK is copied to a volume bind mount on the host to allow multiple containers to use the same base SDK, as well as to perform SDK updates, upgrades, and additional package installations. The initial seeding of the AndroidSDK on the host is performed via:

docker compose run -it --rm \
    android-sdk-manager \
    init

Install packages into SDK

The following will install Android platform 35.

ANDROID_PLATFORM=35
docker compose run -it --rm \
    android-sdk-manager -- \
    sdkmanager \
        "build-tools;${ANDROID_PLATFORM}.0.0" \
        "platforms;android-${ANDROID_PLATFORM}" \
        "platform-tools"

At this point, ./AndroidSDK contains the latest SDK. The docker-compose.yml for the android-dev-container will mount ./AndroidSDK to /opt/android-sdk.

Copy the base SDK to the mounted 'sdk' directory

docker compose run -it --rm \
    android-dev-container -- \
    bash -c 'cp -a $ANDROID_HOME/. /sdk/'

Seed the flutter repository

git clone https://github.com/flutter/flutter.git

To seed a new project (once per project)

PROJECT=foo
PROJECT_TYPE=expo # flutter
./seed.sh "${PROJECT_TYPE}" "${PROJECT}"

To develop

PROJECT=foo
PROJECT_TYPE=expo
./develop.sh "${PROJECT_TYPE}" "${PROJECT}"

To access the shell of the running project

PROJECT=foo
./shell.sh "${PROJECT}"

To stop development container

docker compose stop "${PROJECT}"
Description
expo and flutter development container for Android
Readme 332 KiB