• Stars
    star
    490
  • Rank 89,811 (Top 2 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🏗 Minimal Android AOSP build environment with handy automation wrapper scripts

Android Open Source Project Docker Build Environment

Docker Stars Docker Pulls ImageLayers

Minimal build environment for AOSP with handy automation wrapper scripts.

Developers can use the Docker image to build directly while running the distribution of choice, without having to worry about breaking the delicate AOSP build due to package updates as is sometimes common on bleeding edge rolling distributions like Arch Linux.

Production build servers and integration test servers should also use the same Docker image and environment. This eliminates most surprise breakages by by empowering developers and production builds to use the exact same environment. The devs will catch the issues with build environment first.

This works well on Linux. Running this via boot2docker (and friends) will result in a very painful performacne hit due to VirtualBox's vboxsf shared folder service which works terrible for very large file shares like AOSP. It might work, but consider yourself warned. If you're aware of another way to get around this, send a pull request!

Quickstart

For the terribly impatient.

  1. Make a directory to work and go there.

  2. Export the current directory as the persistent file store for the aosp wrapper.

  3. Run a self contained build script, which does:

    1. Attempts to fetch the aosp wrapper if not found locally.

    2. Runs the aosp wrapper with an extra argument for the docker binary and hints to the same script that when run later it's running in the docker container.

    3. The aosp wrapper then does it's magic which consists of fetching the docker image if not found and forms all the necessary docker run arguments seamlessly.

    4. The docker container runs the other half the build script which initializes the repo, fetches all source code, and builds.

    5. In parallel you are expected to be drinking because I save you some time.

       mkdir nougat ; cd nougat
       export AOSP_VOL=$PWD
       curl -O https://raw.githubusercontent.com/kylemanna/docker-aosp/master/tests/build-nougat.sh
       bash ./build-nougat.sh
      

    This takes about 2 hours to download and build on i5-2500k with 100Mb/s network connection.

How it Works

The Dockerfile contains the minimal packages necessary to build Android based on the main Ubuntu base image.

The aosp wrapper is a simple wrapper to simplify invocation of the Docker image. The wrapper ensures that a volume mount is accessible and has valid permissions for the aosp user in the Docker image (this unfortunately requires sudo). It also forwards an ssh-agent in to the Docker container so that private git repositories can be accessed if needed.

The intention is to use aosp to prefix all commands one would run in the Docker container. For example to run repo sync in the Docker container:

aosp repo sync -j2

The aosp wrapper doesn't work well with setting up environments, but with some bash magic, this can be side stepped with short little scripts. See tests/build-nougat.sh for an example of a complete fetch and build of AOSP.

Docker Compose

A Docker Compose file is provided in the root of this repository, you can tweak it as need be:

version: "2"

services:
  aosp:
    image: kylemanna/aosp:latest
    volumes:
      - /tmp/ccache:/ccache
      - ~/aosp:/aosp

Example run: docker-compose run --rm aosp repo sync -j4 -- your android build directory will be in ~/aosp.

Issues

There are some known issues with using Docker Toolbox on macOS and current virtualization technologies resulting in unusual user ID assignments and very poor performing virtualization file sharing implementations with things like VirtualBox. It's recommended to run this image completely in a virtual machine with enough space to fit the entire build (80GB+) as opposed to mapping the build to the local macOS file system via VirtualBox or similar.

Tested

  • Android Kitkat android-4.4.4_r2.0.1
  • Android Lollipop android-5.0.2_r1
  • Android Marshmallow android-6.0.1_r80
  • Android Nougat android-7.0.0_r14

More Repositories

1

docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
Shell
8,325
star
2

docker-bitcoind

💰 Bitcoind Docker image that runs the Bitcoin node in a container for easy deployment
Shell
561
star
3

sniffer

ESP32 Air Quality Sensor with PMSA003 + BME680 and 1.14" LCD
103
star
4

systemd-utils

Random systemd utilities
Python
85
star
5

pydevmem

Python interface to /dev/mem
Python
46
star
6

docker-syncthing-relay

🔁 Syncthing Relay to help Syncthing clients relay data when they can't communicate directly due to things like NAT routers
Dockerfile
33
star
7

imapfilter-tools

Tools to improve imapfilter for use as a reliable SPAM filtering service.
Lua
20
star
8

nanotest

Unit test framework that runs on limited resource devices like microcontrollers as well as PCs
C
18
star
9

devmem3

Enhanced version of devmem2 for accessing /dev/mem and other embedded resources
C++
16
star
10

fosmc

The Fictiv Open Source Motorcycle
15
star
11

docker-tahoe-lafs

Simple Tahoe LAFS storage node
Shell
11
star
12

opalctl

TCG Opal Control Utilities
C
11
star
13

android-ble-battery

Hacky app to read Bluetooth Low Energy Battery Service
10
star
14

kicad-library

My personal KiCAD library
10
star
15

lua-popen3

Utilties for using Lua with external commands
Lua
10
star
16

fssh

Reverse ssh wrapper for Linux X11/Mac OS X copy-paste buffer
Python
9
star
17

docker-zynq7

Build Tools for Yocto on Xilinx Zynq 7000 Series SOCs with ARM Cortex-A9 CPUs + FPGAs
Dockerfile
8
star
18

solar-power-monitor

Raspberry PI 4 + INA3221 + SY-M150-14.6 + LiFePo4 battery + 25W solar panel
Python
8
star
19

kinetis-sdk1

Unofficial mirror of various Kinetis SDK v1.x.x releases
8
star
20

cleanhawk250

✈ CleanHawk 250 Support Documentation + Design Files
KiCad Layout
7
star
21

dot-files

Public version of my dot-files
Vim Script
7
star
22

vagrant-aosp

Vagrant build for providing a dev and build environemtn for AOSP
Shell
7
star
23

freertos

🔂 FreeRTOS Mirror on GitHub
C
5
star
24

blog.kylemanna.com

☢ Live Jekyll repository for my blog
SCSS
5
star
25

docker-cleanup

Clean-up old dangling Docker volumes
Shell
5
star
26

kinetis-sdk2

Attempt at a handy SDK for the NXP Kinetis K22F and KV11 processors
C
5
star
27

dell-xps-9550-precision-5510

Notes from a Dell XPS 15 9550 -> Dell Precision 15 M5510 motherboard swap
Shell
5
star
28

docker-am335x

Cross compiler and build tools for Texas Instrument's AM335x chips (i.e. Beagle Bone) with proper Device Tree and PRU compiler
Shell
5
star
29

kicad-utils

Miscellaneous utilities for Kicad. Primarily Kicad XYRS BOM generator
Python
5
star
30

nordic-sdk-nrf5

C
4
star
31

helium-validator-influx

Helium Validator to InfluxDB
Python
4
star
32

android-utils

Various Android Utilities
Shell
3
star
33

social-utils

Random social media utilities I've hacked together
Python
3
star
34

cmocka-init

Wrapper to simplify the use of cmocka by using linker sets (linker sections + function pointers)
C
3
star
35

repo-manifest-utils

Misc utilities for managing git-repo Android manifest files.
Python
3
star
36

vmware-patch

Fork of https://aur.archlinux.org/packages/vmware-patch/ with newer fixes
Shell
3
star
37

kinetis-frdm-expansion

Expansion Board Template for Freescale Kinetis Freedom Dev Boards
KiCad Layout
3
star
38

docker-ci-embedded

Continuous Integration Build Environment for Embedded ARM Devices
3
star
39

android-blueoothle

Java
2
star
40

embedded-handbook

List of Embedded Microcontroller Resources
2
star
41

lxc-oe

Linux Container (LXC) templates for repeatable Open Embedded builds
Shell
2
star
42

kicad-netlist-headache

Example of KiCad project gone wrong
KiCad Layout
2
star
43

scripts

Python
2
star
44

docker-xtreemfs

Docker build for XtreemFS
Shell
2
star
45

redirect-analytics

Simple HTTP redirection app to log data Google Analytics
PHP
1
star
46

kylemanna.github.com

My personal blog
Ruby
1
star
47

teensy-toslink-receiver

Simple TOSLINK to USB + S/PDIF receiver. Someday + HDMI ARC + HDMI CEC.
1
star
48

openocd

C
1
star
49

relay-sr201

Rust SR-201 Relay controller
Rust
1
star
50

aur

My Personal AUR git submodules
Shell
1
star
51

coinbox

Linux LiveUSB distribution for Bitcoin key generation, storage and transaction signing
Shell
1
star
52

nrf52-jlink-uart-portal

UART breakout for nRF52 to debug external boards with UART riding over SWD to taret
KiCad Layout
1
star