X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/b59e03ab08f85a91406fe79fee55df47d69fc153..365aacb44ead0a100b8e1315ef22743bdf7f15f3:/scripts/Dockerfile diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 8d6c87f3..b2b91e02 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -4,32 +4,32 @@ # docker push termux/package-builder # This is done after changing this file or any of the # scripts/setup-{ubuntu,android-sdk}.sh setup scripts. -FROM ubuntu:16.04 +FROM ubuntu:18.04 # Fix locale to avoid warnings: -RUN locale-gen en_US.UTF-8 -RUN dpkg-reconfigure locales - -# We expect this to be mounted with '-v $PWD:/root/termux-packages': -WORKDIR /root/termux-packages +ENV LANG C.UTF-8 # Needed for setup: -ADD ./setup-ubuntu.sh /tmp/setup-ubuntu.sh -ADD ./setup-android-sdk.sh /tmp/setup-android-sdk.sh - -# Allow configure to be run as root: -ENV FORCE_UNSAFE_CONFIGURE 1 +COPY ./setup-ubuntu.sh /tmp/setup-ubuntu.sh +COPY ./setup-android-sdk.sh /tmp/setup-android-sdk.sh # Setup needed packages and the Android SDK and NDK: RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -yq sudo && \ - /tmp/setup-ubuntu.sh && \ - apt-get clean && \ - /tmp/setup-android-sdk.sh && \ + apt-get -yq upgrade && \ + apt-get install -yq sudo && \ + 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: - cd /root/lib/android-ndk/ && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + cd /home/builder/lib/android-ndk/ && \ rm -Rf toolchains/mips* && \ - rm -Rf sources/cxx-stl/gabi++ sources/cxx-stl/llvm-libc++* sources/cxx-stl/system/ sources/cxx-stl/stlport && \ - cd platforms && ls | grep -v android-21 | xargs rm -Rf && \ - cd /root/lib/android-sdk/tools && rm -Rf emulator* lib* proguard templates + rm -Rf sources/cxx-stl/gabi++ sources/cxx-stl/system sources/cxx-stl/stlport sources/cxx-stl/gnu-libstdc++ && \ + cd /home/builder/lib/android-sdk/tools && rm -Rf emulator* lib* proguard templates + +# We expect this to be mounted with '-v $PWD:/home/builder/termux-packages': +WORKDIR /home/builder/termux-packages