Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build env #22

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft

Docker build env #22

wants to merge 22 commits into from

Conversation

tobias-klein
Copy link
Member

@tobias-klein tobias-klein commented Aug 22, 2021

Based on the Dockerfile added by this PR I was able to perform a build. This should be reproducable on any machine that runs Docker.

@zhuiks Feel free to give it a try.

You will need to first download the following files and put them in the working directory under the cloned repo:

You will see that these files are referenced in the top-section of the Dockerfile like this:

ENV JDK_TAR_FILE=jdk-8u301-linux-x64.tar.gz
ENV ANDROID_TOOLS_ZIP=commandlinetools-linux-7583922_latest.zip
ENV ANDROID_NDK_ZIP=android-ndk-r21b-linux-x86_64.zip
ENV ANDROID_NDK_FOLDER=android-ndk-r21b
ENV GRADLE_ZIP=gradle-6.7.1-bin.zip

Note that particularly the Android NDK version is mandatory (requirement described by nodejs-mobile).

If you want to use this based on how it is now:

  1. Download the above mentioned files
  2. Install Docker. Should be apt-get install docker.io
  3. Build a docker image. Run docker build -t ezra-cordova . (Note the . at the end) in the cloned repo working dir.
  4. Run the docker image. Run docker run -it ezra-cordova bash
  5. Clone ezra-bible-app-cordova (including submodules init & update) and run the build.

Open points:

  • Create script for building based on the respective Docker container
  • Dynamically handle release signing properties file
  • Document binary signing procedure

@zhuiks
Copy link
Collaborator

zhuiks commented Aug 24, 2021

Thank you, I'll check it soon

@zhuiks
Copy link
Collaborator

zhuiks commented Aug 24, 2021

I ran from inside docker container:

git clone --recurse-submodules https://github.com/ezra-bible-app/ezra-bible-app-cordova.git

and got:

...
fatal: No url found for submodule path 'ezra-bible-app/lib/emoji-button' in .gitmodules
...

ezra-bible-app/ezra-bible-app#428 should fix it

Copy link
Collaborator

@zhuiks zhuiks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On docker image the build was successful, and I was able to extract apk.
I see the following opportunities for the docker image:

  1. Debug build for developers. I can download required files and install docker. But then it would be nice to run something like docker-build.sh and get my apk in dist folder. For this build it would be nice to connect volume with local ezra-bible-app instead of cloning from github.
  2. Automatic build for github actions. That can be added to other build scripts under Ezra Bible App

Currently, generated apk quietly failing on both emulator and Samsung Galaxy Tab E ☹️
Знімок екрану з 2021-08-24 16-40-54

@tobias-klein
Copy link
Member Author

tobias-klein commented Aug 25, 2021

  1. Debug build for developers. I can download required files and install docker. But then it would be nice to run something like docker-build.sh and get my apk in dist folder. For this build it would be nice to connect volume with local ezra-bible-app instead of cloning from github.

I have a plan to add a script like that. See the open points mentioned above.

You can mount directories into Docker and then run scripts that are physically stored outside of the Docker container.

Try docker run -it -v /home/<ezra-cordova-workspace>:/opt/ezra ezra-cordova /opt/ezra-cordova/build.sh

Replace <ezra-cordova-workspace> with the actual path to your local ezra-bible-app-cordova git workspace.

This mounts your local ezra-bible-app-cordova workspace into the Docker container and then runs the build script. The result should then also be found in your local folder.

  1. Automatic build for github actions. That can be added to other build scripts under Ezra Bible App

We can consider that. However, we may have issues due to Oracle JDK (for licensing reasons). Not sure whether you can just build a Docker image that is shipped with the integrated Oracle JDK.

Currently, generated apk quietly failing on both emulator and Samsung Galaxy Tab E ☹️

Can you generate a log file using adb logcat > debug.log while the device is connected? This requires the adb tools to be installed.

@tobias-klein
Copy link
Member Author

@zhuiks Still looking into this. Note that I found out that the root-cause of the issues with the APK generated in the Docker env. is that a certain important library (libnode.so) for some reason does not get included in the APK. I haven't figured out why yet. Still trying to understand what's the difference between the Docker env. and my (working) build environment on my laptop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants