Git Product home page Git Product logo

docker_droid-builder's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.