Skip to content

A docker image to provide a systemless AOSP build environment

License

Notifications You must be signed in to change notification settings

lsfxz/AOSP-Build-Environment-Docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AOSP build environment in Docker

A easy to use AOSP build environment provided as a Docker image.

This is forked from Trumeet/AOSP-Build-Environment-Docker and somewhat "streamlined" with a focus on building GrapheneOS.

Usage

Notes

The docker-compose.yml and thus docker-compose is used to simplify handling mounts and environment variables.

You can customize some options in the docker-compose.yml to your liking:

The mounted volumes are used to provide outside access to your build dir (the /aosp-mount), as well as separate TMP- and CCACHE-directories. Those might come in handy if your /tmp runs out of space at some point, or if you want to use ccache to save some time on subsequent builds.

The environment variables can be used to enable or disable usage of ccache and the $TMPDIR, as well as to provide custom args to jack.

Remember to set your desired amount of space used for ccache when in the container, eg. ccache -M 20G.

Building the image

UID=${UID} GID=${GID} sudo --preserve-env=UID,GID docker-compose build

Running the image

$UID and $GID are used to keep permissions in line with your current user (and to avoid running everything as root, even inside a somewhat contained environment.)

UID=${UID} GID=${GID} sudo --preserve-env=UID,GID docker-compose run --rm aosp

Known issues

Currently, the container has to be run with --privileged (or rather privileged: true in the docker-compose.yml), as otherwise nsjail will complain. (Seems like even this still doesn't work sufficiently. Hrmpf.)

See:

It might be possible to work around this with appropriate seccomp options.

License

GPL v3, feel free to contribute it.

About

A docker image to provide a systemless AOSP build environment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%