Build AOSP or CustomROM With Docker technology
-
Clone this repository.
git clone https://github.com/EndCredits/Docker_build_AOSP -b main cd Docker_build_AOSP
-
Copy your local git configs.
cp ~/.gitconfig gitconfig
-
Build docker image.
docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) -t android-build-host .
If you are using fish
docker build --build-arg userid=(id -u) --build-arg groupid=(id -g) --build-arg username=(id -un) -t android-build-host .
Note that if you are using proxy tools like v2raya you may need enable
host
network mode by appending--network host
in build command like:docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) -t android-build-host --network host .
-
Set Android Build working directory.
export DOCKER_WORKING_DIRECTORY=<path to your android os source tree>
If you are using fish
set DOCKER_WORKING_DIRECTORY <path to your android os source tree>
-
Start Docker and map the working directory.
docker run -it --rm -v $DOCKER_WORKING_DIRECTORY:/android android-build-host
-
Init repo (e.g. PixelExperience 11 Plus)
cd /android repo init -u https://github.com/PixelExperience/manifest -b eleven-plus
-
Sync up
repo sync -j$(nproc --all) --force-sync --no-tags --no-clone-bundle
-
Add your device specific files.
-
Starting build
. build/envsetup.sh lunch aosp_<codename>-< eng | userdebug | user > m bacon -j$(nproc --all)