Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Building DualBootPatcher using docker images

Youssif Shaaban Alsager edited this page Nov 3, 2018 · 5 revisions

What is docker? [in case you don't know it 😮 ]

Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density. Enterprises use Docker to build agile software delivery pipelines to ship new features faster, more securely and with confidence for both Linux, Windows Server, and Linux-on-mainframe apps.

Firstly, make sure you have docker installed, if not install it From here you should choose a method you'll follow, Building docker images manually or use pre-built docker images.

A) Building docker images manually:

Mr. @chenxiaolong has made docker image configuration files here

all you need to do after sync the repo like part 1 is entering the following commands in DualBootPatcher directory:

./docker/generate.sh

./docker/build.sh

Note that building the docker images will take a long time and consume a lot of bandwidth--multiple gigabytes at the very least. It will download all the dependencies for building DualBootPatcher for all supported targets.

B) Using ready-made docker images:

I have made docker images and uploaded them to docker hub to download "pull" it enter these commands:

docker pull yshalsager/dualbootpatcher:9.3.0-7-base

docker pull yshalsager/dualbootpatcher:9.3.0-7-android

docker pull yshalsager/dualbootpatcher:9.3.0-7-linux


Building DualBootPatcher using docker:

  1. To enter docker container and build DualBootPatcher make folder "builder" in DualBootPatcher directory

cd DualBootPatcher && mkdir -p builder

  1. Then run this to enter android build container

docker run --rm -it -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/builder/DualBootPatcher:rw,z" -v "${HOME}/.android:/builder/.android:rw,z" -v "${HOME}/.ccache:/builder/.ccache:rw,z" -v "${HOME}/.gradle:/builder/.gradle:rw,z" yshalsager/dualbootpatcher:9.3.0-7-android bash

  1. After this you'll continue like normal building:

cd DualBootPatcher/builder && cmake .. -DMBP_BUILD_TARGET=android -DMBP_BUILD_TYPE=debug && make -j16 && rm -rf

assets && cpack -G TXZ && make apk -j16

make android-system_armeabi-v7a -j16 && make -C data/devices -j16

  1. Now exit from container and enter linux build one:

docker run --rm -it -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) -v "$(pwd):/builder/DualBootPatcher:rw,z" -v "${HOME}/.android:/builder/.android:rw,z" -v "${HOME}/.ccache:/builder/.ccache:rw,z" -v "${HOME}/.gradle:/builder/.gradle:rw,z" yshalsager/dualbootpatcher:9.3.0-7-linux bash

  1. Build utilities ZIP:

cd DualBootPatcher/builder && ./utilities/create.sh

  1. And build linux app

cmake .. -DMBP_BUILD_TARGET=desktop -DMBP_PORTABLE=ON && make -j16 && cpack -G TXZ

7. You'll find output files in your local "builder" folder like normal build.

Note: If you generated docker images change yshalsager/dualbootpatcher to chenxiaolong/dualbootpatcher in previous commands.