2018-06-18 21:54:54 +02:00
|
|
|
# Dockerfile for providing buildozer
|
|
|
|
# Build with:
|
|
|
|
# docker build --tag=buildozer .
|
2018-12-28 12:30:39 +01:00
|
|
|
#
|
2018-06-18 21:54:54 +02:00
|
|
|
# In order to give the container access to your current working directory
|
|
|
|
# it must be mounted using the --volume option.
|
|
|
|
# Run with (e.g. `buildozer --version`):
|
|
|
|
# docker run --volume "$(pwd)":/home/user/hostcwd buildozer --version
|
|
|
|
# Or for interactive shell:
|
|
|
|
# docker run --volume "$(pwd)":/home/user/hostcwd --entrypoint /bin/bash -it --rm buildozer
|
2018-12-28 12:30:39 +01:00
|
|
|
|
2018-06-18 21:54:54 +02:00
|
|
|
FROM ubuntu:18.04
|
|
|
|
|
|
|
|
ENV USER="user"
|
|
|
|
ENV HOME_DIR="/home/${USER}"
|
|
|
|
ENV WORK_DIR="${HOME_DIR}/hostcwd" \
|
2019-03-08 01:18:04 +01:00
|
|
|
SRC_DIR="${HOME_DIR}/src" \
|
2018-06-18 21:54:54 +02:00
|
|
|
PATH="${HOME_DIR}/.local/bin:${PATH}"
|
|
|
|
|
|
|
|
# configures locale
|
|
|
|
RUN apt update -qq > /dev/null && \
|
|
|
|
apt install -qq --yes --no-install-recommends \
|
|
|
|
locales && \
|
|
|
|
locale-gen en_US.UTF-8
|
|
|
|
ENV LANG="en_US.UTF-8" \
|
|
|
|
LANGUAGE="en_US.UTF-8" \
|
|
|
|
LC_ALL="en_US.UTF-8"
|
|
|
|
|
|
|
|
# installs system dependencies (required to setup all the tools)
|
|
|
|
RUN apt install -qq --yes --no-install-recommends \
|
2019-03-08 01:18:04 +01:00
|
|
|
sudo python3-pip python3-setuptools file
|
2018-06-18 21:54:54 +02:00
|
|
|
|
|
|
|
# https://buildozer.readthedocs.io/en/latest/installation.html#android-on-ubuntu-18-04-64bit
|
|
|
|
RUN dpkg --add-architecture i386 && apt update -qq > /dev/null && \
|
|
|
|
apt install -qq --yes --no-install-recommends \
|
|
|
|
build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 \
|
2019-03-08 01:18:04 +01:00
|
|
|
libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python3 \
|
|
|
|
python3-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386
|
2018-06-18 21:54:54 +02:00
|
|
|
|
|
|
|
# prepares non root env
|
|
|
|
RUN useradd --create-home --shell /bin/bash ${USER}
|
|
|
|
# with sudo access and no password
|
|
|
|
RUN usermod -append --groups sudo ${USER}
|
|
|
|
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
|
|
|
|
|
|
USER ${USER}
|
|
|
|
WORKDIR ${WORK_DIR}
|
2019-03-08 01:18:04 +01:00
|
|
|
COPY --chown=user:user . ${SRC_DIR}
|
2018-06-18 21:54:54 +02:00
|
|
|
|
|
|
|
# installs buildozer and dependencies
|
2019-03-08 01:18:04 +01:00
|
|
|
RUN pip3 install --user Cython==0.28.6 ${SRC_DIR}
|
2018-06-18 21:54:54 +02:00
|
|
|
|
|
|
|
ENTRYPOINT ["buildozer"]
|