Work in progress. It may not work. I am waiting for your feedback : don't hesitate to add issues.
Create a rapid development environment for building Android systems without taking the head. You can compile for almost all Android versions.
By default you will have the recommended environment depending on the Android version.
I need feedback for old Android versions (from Android 8 to Android 1.5).
These containers are for "manual" use. They replace for example the use of a virtual machine. They are not optimized for automatic construction.
Containers are updates automatically every week and every time I make a change.
You must choose for which version of Android you will have to compile when you will define the image tag :
android-latestandroid-13android-12android-11android-10android-9android-8android-7android-6android-5android-4android-2.3android-2.2android-2.1android-2.0android-1.6android-1.5
Some tags share same image :
- from
android-latesttoandroid-9 - from
android-8toandroid-7 - from
android-4toandroid-2.3 - from
android-2.2toandroid-1.5
latest tag reference android-latest to android-9.
You can choose also choose which distribution to use. You can find more information about how choosing the right version at ./doc/version.md
Here is the minimal command for starting the container (change /PATH/ANDROID_SOURCES with your Android path) :
docker run \
-d \ # run in background
-v /PATH/ANDROID_SOURCES:/workspace \ # mount your local directory
-e UID=$UID \ # for using same id as your host user
-e GID=$UID \ # same for group
-e GIT_USERNAME="My Name" \ # need for repo command
-e GIT_MAIL="my@mail.com" \ # same as before
--name builder-android-13 \ # optional : set any name for simpler manage the container
ak1pe/android-aosp-build:android-13 # choose your android versionThen you can control the shell :
docker exec -it builder-android-13 bash # "builder-android-13" is what we define with "--name"Now you can execute any commands for building.
Work with podman too.
Here is the same minimal configuration with docker-compose.yml :
# docker-compose.yml
---
version: "3.5"
services:
builder-android-13:
image: "ak1pe/android-aosp-build:android-13"
environment:
UID: ${UID:-1000}
GID: ${UID:-1000}
GIT_USERNAME: "Test Name"
GIT_MAIL: "mail@test.com"
volumes:
- /PATH/HOST/ANDROID_WORKSPACE:/workspace
Then you can start the container :
docker compose up -d docker-compose.ymlAt last you can control the shell :
docker compose exec builder-android-13 bashNow you can execute any commands for building.
More information at doc/docker-compose.md.
By default your will have Python 3 used when available.
You will need to switch to Python 2 in relation to certain moments of the constructions, for example before building most Android versions.
When you are connect to the shell, you can switch with this commands :
- Python 2
source /python/3/bin/activate- Python 3
source /python/2/bin/activate- Revert back
deactivateIf you have this kind of errors :
[ 0% 21/13012] Generated: (.../out/target/product/DEVICE/> android-info.txt) FAILED: .../out/target/product/DEVICE/android-info.txt /bin/bash -c "(build/make/tools/check_radio_versions.py ) && (echo \"board=sm6150\" > .../out/target/product/DEVICE/android-info.txt )" File "build/make/tools/check_radio_versions.py", line 56 print "*** Error opening \"%s.sha1\"; can't verify %s" % (fn, key) ^ SyntaxError: invalid syntax [ 0% 38/13012] target C++: recovery-refresh <= bootable/recovery/rotate_logs.cpp ninja: build stopped: subcommand failed. 18:17:52 ninja failed with: exit status 1Then you should try to change the version of Python used.
- Which version to use ? doc/version.md
- How to change the version of Python ? doc/python.md
- How to enter inside the container ? doc/shell.md
- How to use it with
docker compose? doc/docker-compose.md - How to build myself ? doc/build.md
- What resources I used : doc/external_resources.md
These project is under MIT License, except for files jdk-6u45-linux-x64.bin & jdk-1_5_0_22-linux-amd64.bin which are under the Oracle Binary Code License Agreement for Java SE license.
When you use these images version :
android-4android-2.3android-2.2android-2.1android-2.0android-1.6android-1.5
Your automatically accept the Oracle Binary Code License Agreement for Java SE license.