From 95d3db881d6e1f66d0668ac9001e6782cdff58f9 Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Thu, 13 Jul 2017 14:57:55 -0400 Subject: [PATCH 1/4] Add docker compose file and update README --- README.md | 41 +++++++++++++++++++++++++++++++++++------ docker-compose.yml | 9 +++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index c24c831..5aca5c2 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,10 @@ For the terribly impatient. 5. In parallel you are expected to be drinking because I save you some time. - mkdir kitkat ; cd kitkat + mkdir marshmallow ; cd marshmallow export AOSP_VOL=$PWD - curl -O https://raw.githubusercontent.com/kylemanna/docker-aosp/master/tests/build-kitkat.sh - bash ./build-kitkat.sh + curl -O https://raw.githubusercontent.com/kylemanna/docker-aosp/master/tests/build-marshmallow.sh + bash ./build-marshmallow.sh How it Works ------------ @@ -70,12 +70,41 @@ Docker container. For example to run `repo sync` in the Docker container: 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-kitkat.sh` for an example of a complete fetch and build of AOSP. +`tests/build-marshmallow.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: + +```yaml +version: "2" + +services: + aosp: + image: kylemanna/aosp:6.0-marshmallow + 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 KitKat `android-4.4.4_r2.0.1` * Android Lollipop `android-5.0.2_r1` -* Android Marshmallow `android-6.0.1_r72` +* Android Marshmallow `android-6.0.1_r80` +* Android Nougat `android-7.0.0_r14` + +[Docker Compose]: https://docs.docker.com/compose diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..51bbc3c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "2" + +services: + aosp: + image: kylemanna/aosp:6.0-marshmallow + volumes: + - /tmp/ccache:/ccache + - ~/aosp:/aosp + - ~/.gitconfig:/root/.gitconfig From 0760bb0b9cf3b4325744255d6819bee5c0cce4c7 Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Sat, 15 Jul 2017 07:39:25 -0400 Subject: [PATCH 2/4] Update to MM release 80 --- tests/build-marshmallow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/build-marshmallow.sh b/tests/build-marshmallow.sh index 7507097..38c1cc3 100755 --- a/tests/build-marshmallow.sh +++ b/tests/build-marshmallow.sh @@ -9,7 +9,7 @@ set -ex if [ "$1" = "docker" ]; then - TEST_BRANCH=${TEST_BRANCH:-android-6.0.1_r72} + TEST_BRANCH=${TEST_BRANCH:-android-6.0.1_r80} TEST_URL=${TEST_URL:-https://android.googlesource.com/platform/manifest} cpus=$(grep ^processor /proc/cpuinfo | wc -l) From 5e98c9368ebb1783dea109868f7f670c9af991cd Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Sat, 15 Jul 2017 19:12:25 -0400 Subject: [PATCH 3/4] CCache doesn't seem to be working -- add this in the entrypoint --- Dockerfile | 4 ---- utils/docker_entrypoint.sh | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c238644..c5d5570 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,10 +50,6 @@ COPY ssh_config /root/.ssh/config # considered to be ephemeral VOLUME ["/tmp/ccache", "/aosp"] -# Improve rebuild performance by enabling compiler cache -ENV USE_CCACHE 1 -ENV CCACHE_DIR /tmp/ccache - # Work in the build directory, repo is expected to be init'd here WORKDIR /aosp diff --git a/utils/docker_entrypoint.sh b/utils/docker_entrypoint.sh index a607159..f40c609 100755 --- a/utils/docker_entrypoint.sh +++ b/utils/docker_entrypoint.sh @@ -17,6 +17,10 @@ set -e if [ -z ${USER_ID+x} ]; then USER_ID=1000; fi if [ -z ${GROUP_ID+x} ]; then GROUP_ID=1000; fi +# ccache +export CCACHE_DIR=/tmp/ccache +export USE_CCACHE=1 + msg="docker_entrypoint: Creating user UID/GID [$USER_ID/$GROUP_ID]" && echo $msg groupadd -g $GROUP_ID -r aosp && \ useradd -u $USER_ID --create-home -r -g aosp aosp From 99329daa313fb4b81c30fe7a9cf81f31cf133189 Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Sat, 15 Jul 2017 19:33:31 -0400 Subject: [PATCH 4/4] store ccache volume in the source directory; volume incorrectly mapped --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 51bbc3c..d7bef62 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,6 @@ services: aosp: image: kylemanna/aosp:6.0-marshmallow volumes: - - /tmp/ccache:/ccache + - ~/aosp/ccache:/tmp/ccache - ~/aosp:/aosp - ~/.gitconfig:/root/.gitconfig