| 1 | # Build with 'docker build -t termux/package-builder .' and push |
| 2 | # to docker hub with 'docker push termux/package-builder' after |
| 3 | # changing scripts/setup-ubuntu.sh or scripts/setup-android.sdk.sh. |
| 4 | FROM ubuntu:16.04 |
| 5 | |
| 6 | # Fix locale to avoid warnings: |
| 7 | RUN locale-gen en_US.UTF-8 |
| 8 | RUN dpkg-reconfigure locales |
| 9 | |
| 10 | # We expect this to be mounted with '-v $PWD:/root/termux-packages': |
| 11 | WORKDIR /root/termux-packages |
| 12 | |
| 13 | # Needed for setup: |
| 14 | ADD ./setup-ubuntu.sh /tmp/setup-ubuntu.sh |
| 15 | ADD ./setup-android-sdk.sh /tmp/setup-android-sdk.sh |
| 16 | |
| 17 | # Allow configure to be run as root: |
| 18 | ENV FORCE_UNSAFE_CONFIGURE 1 |
| 19 | |
| 20 | # Setup needed packages and the Android SDK and NDK: |
| 21 | RUN apt-get update && \ |
| 22 | DEBIAN_FRONTEND=noninteractive apt-get install -yq sudo && \ |
| 23 | /tmp/setup-ubuntu.sh && \ |
| 24 | apt-get clean && \ |
| 25 | /tmp/setup-android-sdk.sh && \ |
| 26 | # Removed unused parts to make a smaller Docker image: |
| 27 | cd /root/lib/android-ndk/ && \ |
| 28 | rm -Rf toolchains/mips* && \ |
| 29 | rm -Rf sources/cxx-stl/gabi++ sources/cxx-stl/llvm-libc++* sources/cxx-stl/system/ sources/cxx-stl/stlport && \ |
| 30 | cd platforms && ls | grep -v android-21 | xargs rm -Rf && \ |
| 31 | cd /root/lib/android-sdk/tools && rm -Rf emulator* lib* proguard templates |
| 32 | |