{"id":13437318,"url":"https://github.com/kylemanna/docker-aosp","last_synced_at":"2025-04-05T04:14:28.868Z","repository":{"id":23115673,"uuid":"26470171","full_name":"kylemanna/docker-aosp","owner":"kylemanna","description":"🏗 Minimal Android AOSP build environment with handy automation wrapper scripts","archived":false,"fork":false,"pushed_at":"2017-12-30T12:58:35.000Z","size":47,"stargazers_count":509,"open_issues_count":20,"forks_count":242,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-29T03:11:17.640Z","etag":null,"topics":["android","aosp","docker","docker-image","wrapper"],"latest_commit_sha":null,"homepage":"https://registry.hub.docker.com/u/kylemanna/aosp/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylemanna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-11T04:59:31.000Z","updated_at":"2025-03-27T06:39:24.000Z","dependencies_parsed_at":"2022-07-17T02:00:37.695Z","dependency_job_id":null,"html_url":"https://github.com/kylemanna/docker-aosp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemanna%2Fdocker-aosp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemanna%2Fdocker-aosp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemanna%2Fdocker-aosp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemanna%2Fdocker-aosp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylemanna","download_url":"https://codeload.github.com/kylemanna/docker-aosp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284953,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","aosp","docker","docker-image","wrapper"],"created_at":"2024-07-31T03:00:55.953Z","updated_at":"2025-04-05T04:14:28.848Z","avatar_url":"https://github.com/kylemanna.png","language":"Shell","funding_links":[],"categories":["HarmonyOS","Shell"],"sub_categories":["Windows Manager"],"readme":"Android Open Source Project Docker Build Environment\n====================================================\n\n[![Docker Stars](https://img.shields.io/docker/stars/kylemanna/aosp.svg)](https://hub.docker.com/r/kylemanna/aosp/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/kylemanna/aosp.svg)](https://hub.docker.com/r/kylemanna/aosp/)\n[![ImageLayers](https://images.microbadger.com/badges/image/kylemanna/aosp.svg)](https://microbadger.com/#/images/kylemanna/aosp)\n\nMinimal build environment for AOSP with handy automation wrapper scripts.\n\nDevelopers can use the Docker image to build directly while running the\ndistribution of choice, without having to worry about breaking the delicate\nAOSP build due to package updates as is sometimes common on bleeding edge\nrolling distributions like Arch Linux.\n\nProduction build servers and integration test servers should also use the same\nDocker image and environment. This eliminates most surprise breakages by\nby empowering developers and production builds to use the exact same\nenvironment.  The devs will catch the issues with build environment first.\n\nThis works well on Linux.  Running this via `boot2docker` (and friends) will\nresult in a very painful performacne hit due to VirtualBox's `vboxsf` shared\nfolder service which works terrible for **very** large file shares like AOSP.\nIt might work, but consider yourself warned.  If you're aware of another way to\nget around this, send a pull request!\n\n\nQuickstart\n----------\n\nFor the terribly impatient.\n\n1. Make a directory to work and go there.\n2. Export the current directory as the persistent file store for the `aosp`\n   wrapper.\n3. Run a self contained build script, which does:\n    1. Attempts to fetch the `aosp` wrapper if not found locally.\n    2. Runs the `aosp` wrapper with an extra argument for the docker binary and\n       hints to the same script that when run later it's running in the docker\n       container.\n    3. The aosp wrapper then does it's magic which consists of fetching the\n       docker image if not found and forms all the necessary docker run\n       arguments seamlessly.\n    4. The docker container runs the other half the build script which\n       initializes the repo, fetches all source code, and builds.\n    5. In parallel you are expected to be drinking because I save you some time.\n\n            mkdir nougat ; cd nougat\n            export AOSP_VOL=$PWD\n            curl -O https://raw.githubusercontent.com/kylemanna/docker-aosp/master/tests/build-nougat.sh\n            bash ./build-nougat.sh\n\n    This takes about 2 hours to download and build on i5-2500k with 100Mb/s network connection.\n\nHow it Works\n------------\n\nThe Dockerfile contains the minimal packages necessary to build Android based\non the main Ubuntu base image.\n\nThe `aosp` wrapper is a simple wrapper to simplify invocation of the Docker\nimage.  The wrapper ensures that a volume mount is accessible and has valid\npermissions for the `aosp` user in the Docker image (this unfortunately\nrequires sudo).  It also forwards an ssh-agent in to the Docker container\nso that private git repositories can be accessed if needed.\n\nThe intention is to use `aosp` to prefix all commands one would run in the\nDocker container.  For example to run `repo sync` in the Docker container:\n\n    aosp repo sync -j2\n\nThe `aosp` wrapper doesn't work well with setting up environments, but with\nsome bash magic, this can be side stepped with short little scripts.  See\n`tests/build-nougat.sh` for an example of a complete fetch and build of AOSP.\n\n[Docker Compose][]\n------\n\nA [Docker Compose][] file is provided in the root of this repository, you can tweak it as need be:\n\n```yaml\nversion: \"2\"\n\nservices:\n  aosp:\n    image: kylemanna/aosp:latest\n    volumes:\n      - /tmp/ccache:/ccache\n      - ~/aosp:/aosp\n```\nExample run: `docker-compose run --rm aosp repo sync -j4` -- your android build directory will be in `~/aosp`.\n\nIssues\n------\n\nThere are some known issues with using Docker Toolbox on macOS and current\nvirtualization technologies resulting in unusual user ID assignments and very\npoor performing virtualization file sharing implementations with things like\nVirtualBox.  It's recommended to run this image completely in a virtual machine\nwith enough space to fit the entire build (80GB+) as opposed to mapping the\nbuild to the local macOS file system via VirtualBox or similar.\n\nTested\n------\n\n* Android Kitkat `android-4.4.4_r2.0.1`\n* Android Lollipop `android-5.0.2_r1`\n* Android Marshmallow `android-6.0.1_r80`\n* Android Nougat `android-7.0.0_r14`\n\n[Docker Compose]: https://docs.docker.com/compose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemanna%2Fdocker-aosp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylemanna%2Fdocker-aosp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemanna%2Fdocker-aosp/lists"}