Coder Social home page Coder Social logo

akipe / android-aosp-build-docker Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 109.64 MB

Create a rapid development environment for building Android systems without taking the head.

License: MIT License

Dockerfile 26.69% Shell 73.31%
android android-room docker docker-image android-system aosp aosp-android aosp-build

android-aosp-build-docker's Introduction

Android AOSP Build with Docker

main

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.

How to

Choose your version

You must choose for which version of Android you will have to compile when you will define the image tag :

  • android-latest
  • android-13
  • android-12
  • android-11
  • android-10
  • android-9
  • android-8
  • android-7
  • android-6
  • android-5
  • android-4
  • android-2.3
  • android-2.2
  • android-2.1
  • android-2.0
  • android-1.6
  • android-1.5

Some tags share same image :

  • from android-latest to android-9
  • from android-8 to android-7
  • from android-4 to android-2.3
  • from android-2.2 to android-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

Run with docker

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="[email protected]" \ # 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 version

Then 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.

Run with docker compose

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: "[email protected]"
        volumes:
        - /PATH/HOST/ANDROID_WORKSPACE:/workspace

Then you can start the container :

docker compose up -d docker-compose.yml

At last you can control the shell :

docker compose exec builder-android-13 bash

Now you can execute any commands for building.

More information at doc/docker-compose.md.

Switch Python version

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
deactivate

If 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 1

Then you should try to change the version of Python used.

Documentation

License

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-4
  • android-2.3
  • android-2.2
  • android-2.1
  • android-2.0
  • android-1.6
  • android-1.5

Your automatically accept the Oracle Binary Code License Agreement for Java SE license.

android-aosp-build-docker's People

Contributors

akipe avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

th3on3

android-aosp-build-docker's Issues

Device specific flicks

Is it possible to implement patch/driver/custom kernel injection? I plan on building a clean AOSP 7.0 for an Exynos 7420 system (Samsung Galaxy S6 SM-G920FD). Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.