Skip to content

Standalone Docker Container based upon Updated Ubuntu LTS for Building Android ROMs or Recovery Projects

License

Notifications You must be signed in to change notification settings

rokibhasansagar/docker_droid-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Droid Builder - One Image To Build Them All

Standalone Docker Container based upon Updated Ubuntu 18.04/20.04 LTS for Building Android ROMs or Recovery Projects

Actions Status Container Builder Platform License Latest Commit Docker Pulls

Available Tags of the Docker Image

Bionic-based Image Info and It's Size: Image Tag Docker Image Size (bionic) MicroBadger Layers

Focal-based Image Info and It's Size: Image Tag Docker Image Size (focal) MicroBadger Layers

Get the Image

You might want to start the bash environment as root user by running sudo -s.

Now, you have choose on which platform you want to build. You got Bionic Beaver (18.04 LTS) and Focal Fossa (20.04 LTS).

Pull the image of by running the following command.

# If you want only bionic, run this ---
docker pull fr3akyphantom/droid-builder:bionic
# But if you want focal, run this instead ---
docker pull fr3akyphantom/droid-builder:focal

Run the Container

Set TAG as "bionic" or "focal", according to your specified needs. By default, "latest" tag is reserved for "focal" container (Ubuntu 18.04 is too old now).

docker run --privileged --rm -i \
  # optionally set/change the name/hostname of the container
  --name docker_droid-builder --hostname droid-builder \
  -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) \
  # mount working directory as volume, '/home/builder' must be the Container's mount path
  -v "$HOME:/home/builder:rw,z" \
  # mount ccache volume too, host machine must have $HOME/.ccache folder if ccache is not installed
  -v "$HOME/.ccache:/srv/ccache:rw" \
  fr3akyphantom/droid-builder:${TAG} \
  /bin/bash

Start the Build

When this Image runs as the droid-builder Container, You won't need to install any other softwares.

Check the Dockerfile to know more detail about installed packages.

When Docker Container is started, run the following commands...

# Change directory to any sub-folder (name as you like)
mkdir -p ${PROJECT_DIR} && cd ${PROJECT_DIR}

# Set your github usename and email, required by repo binary
git config --global user.email $GitHubMail
git config --global user.name $GitHubName
git config --global color.ui true

# Initialize the repo here to begin
repo init --depth 1 -q -u https://github.com/${DEMO_ORG}/${DEMO_MANIFEST}.git -b ${MANIFEST_BRANCH}

# sync the repo with maximum connections
# wait for the whole repo to be downloaded
repo sync -c -q --force-sync --no-clone-bundle --no-tags -j$(nproc --all)

# clone the specific device trees
git clone https://github.com/${DEMO_USER}/${DEVICE_REPONAME} device/${VENDOR}/${CODENAME}
# and other dependent repos too, if you need.

# Start the Build Process
export ALLOW_MISSING_DEPENDENCIES=true
source build/envsetup.sh
# Set FLAVOR as "eng" or "userdebug"
lunch omni_${CODENAME}-${FLAVOR}

# you can now delete the .repo folder if you need more space,
# but it is not recommended for multiple builds or shared projects

# build only recovery image or make full ROM/otapackage
make -j$(nproc --all) recoveryimage || make -j$(($(nproc --all) / 2)) otapackage

Well, there you have it!

Do away with your imagination.

About

Standalone Docker Container based upon Updated Ubuntu LTS for Building Android ROMs or Recovery Projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages