2016-10-07 19:36:58 +02:00
|
|
|
# Build with:
|
2019-02-13 11:13:14 +01:00
|
|
|
# docker build -t termux/package-builder .
|
2016-10-07 19:36:58 +02:00
|
|
|
# Push to docker hub with:
|
2019-02-13 11:13:14 +01:00
|
|
|
# docker push termux/package-builder
|
2016-10-07 19:36:58 +02:00
|
|
|
# This is done after changing this file or any of the
|
|
|
|
# scripts/setup-{ubuntu,android-sdk}.sh setup scripts.
|
2022-02-03 20:57:57 +01:00
|
|
|
FROM ubuntu:21.10
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
# Fix locale to avoid warnings:
|
2020-01-03 23:19:29 +01:00
|
|
|
ENV LANG en_US.UTF-8
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
# Needed for setup:
|
2019-11-10 16:15:33 +01:00
|
|
|
COPY ./setup-ubuntu.sh ./setup-android-sdk.sh ./properties.sh /tmp/
|
2016-05-28 00:24:50 +02:00
|
|
|
|
|
|
|
# Setup needed packages and the Android SDK and NDK:
|
|
|
|
RUN apt-get update && \
|
2019-02-13 11:13:14 +01:00
|
|
|
apt-get -yq upgrade && \
|
2021-10-05 17:40:30 +02:00
|
|
|
apt-get install -yq sudo lsb-release software-properties-common && \
|
2019-02-13 11:13:14 +01:00
|
|
|
adduser --disabled-password --shell /bin/bash --gecos "" builder && \
|
|
|
|
echo "builder ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/builder && \
|
|
|
|
chmod 0440 /etc/sudoers.d/builder && \
|
|
|
|
su - builder -c /tmp/setup-ubuntu.sh && \
|
|
|
|
su - builder -c /tmp/setup-android-sdk.sh && \
|
|
|
|
# Removed unused parts to make a smaller Docker image:
|
2021-10-05 17:40:30 +02:00
|
|
|
apt-get remove -yq --autoremove lsb-release software-properties-common && \
|
2019-11-10 16:15:33 +01:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
cd /home/builder/lib/android-ndk/ && \
|
|
|
|
rm -Rf sources/cxx-stl/system && \
|
|
|
|
cd /home/builder/lib/android-sdk/tools && \
|
|
|
|
rm -Rf emulator* lib* proguard templates
|
2017-01-22 23:13:48 +01:00
|
|
|
|
2019-02-21 02:05:58 +01:00
|
|
|
# Switch User
|
|
|
|
USER builder:builder
|
|
|
|
|
2017-01-22 23:13:48 +01:00
|
|
|
# We expect this to be mounted with '-v $PWD:/home/builder/termux-packages':
|
|
|
|
WORKDIR /home/builder/termux-packages
|