Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🏗 Minimal Android AOSP build environment with handy automation wrapper scripts

License

NotificationsYou must be signed in to change notification settings

kylemanna/docker-aosp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker StarsDocker PullsImageLayers

Minimal build environment for AOSP with handy automation wrapper scripts.

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

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

This works well on Linux. Running this viaboot2docker (and friends) willresult in a very painful performacne hit due to VirtualBox'svboxsf sharedfolder service which works terrible forvery large file shares like AOSP.It might work, but consider yourself warned. If you're aware of another way toget 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 theaospwrapper.

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

    1. Attempts to fetch theaosp wrapper if not found locally.

    2. Runs theaosp wrapper with an extra argument for the docker binary andhints to the same script that when run later it's running in the dockercontainer.

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

    4. The docker container runs the other half the build script whichinitializes 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 basedon the main Ubuntu base image.

Theaosp wrapper is a simple wrapper to simplify invocation of the Dockerimage. The wrapper ensures that a volume mount is accessible and has validpermissions for theaosp user in the Docker image (this unfortunatelyrequires sudo). It also forwards an ssh-agent in to the Docker containerso that private git repositories can be accessed if needed.

The intention is to useaosp to prefix all commands one would run in theDocker container. For example to runrepo sync in the Docker container:

aosp repo sync -j2

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

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

version:"2"services:aosp:image:kylemanna/aosp:latestvolumes:      -/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 currentvirtualization technologies resulting in unusual user ID assignments and verypoor performing virtualization file sharing implementations with things likeVirtualBox. It's recommended to run this image completely in a virtual machinewith enough space to fit the entire build (80GB+) as opposed to mapping thebuild to the local macOS file system via VirtualBox or similar.

Tested

  • Android Kitkatandroid-4.4.4_r2.0.1
  • Android Lollipopandroid-5.0.2_r1
  • Android Marshmallowandroid-6.0.1_r80
  • Android Nougatandroid-7.0.0_r14

About

🏗 Minimal Android AOSP build environment with handy automation wrapper scripts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp