buildozer/Dockerfile

82 lines
2.1 KiB
Docker
Raw Normal View History

# Dockerfile for providing buildozer
#
# Build with:
# docker build --tag=kivy/buildozer .
2018-12-28 12:30:39 +01: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 "$HOME/.buildozer":/home/user/.buildozer \
# --volume "$PWD":/home/user/hostcwd \
# kivy/buildozer --version
#
# Or for interactive shell:
# docker run --interactive --tty --rm \
# --volume "$HOME/.buildozer":/home/user/.buildozer \
# --volume "$PWD":/home/user/hostcwd \
# --entrypoint /bin/bash \
# kivy/buildozer
#
# If you get a `PermissionError` on `/home/user/.buildozer/cache`,
# try updating the permissions from the host with:
# sudo chown $USER -R ~/.buildozer
# Or simply recreate the directory from the host with:
# rm -rf ~/.buildozer && mkdir ~/.buildozer
2018-12-28 12:30:39 +01:00
FROM ubuntu:18.04
ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/hostcwd" \
SRC_DIR="${HOME_DIR}/src" \
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"
# system requirements to build most of the recipes
:whale: Fixes Docker apt cache missed Applies "cache busting" to avoid apt cache miss: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run The error was: ``` After this operation, 905 MB of additional disk space will be used. E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/f/file/libmagic-mgc_5.32-2ubuntu0.3_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/f/file/libmagic1_5.32-2ubuntu0.3_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/f/file/file_5.32-2ubuntu0.3_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-96.97_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_2.2.7-1ubuntu2.7_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/o/openldap/libldap-common_2.4.45+dfsg-1ubuntu1.4_all.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/o/openldap/libldap-2.4-2_2.4.45+dfsg-1ubuntu1.4_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/pulseaudio/libpulse0_11.1-1ubuntu7.5_amd64.deb 404 Not Found [IP: 91.189.88.142 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? ```
2020-05-17 13:09:59 +02:00
RUN apt update -qq > /dev/null && \
apt install -qq --yes --no-install-recommends \
autoconf \
automake \
build-essential \
ccache \
cmake \
gettext \
git \
libffi-dev \
libltdl-dev \
libssl-dev \
libtool \
openjdk-8-jdk \
patch \
pkg-config \
python3-pip \
python3-setuptools \
sudo \
unzip \
zip \
zlib1g-dev
# 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}
COPY --chown=user:user . ${SRC_DIR}
# installs buildozer and dependencies
RUN pip3 install --user --upgrade Cython==0.28.6 wheel pip virtualenv ${SRC_DIR}
ENTRYPOINT ["buildozer"]