diff --git a/fbs/_defaults/src/build/docker/arch/.bashrc b/fbs/_defaults/src/build/docker/arch/.bashrc index 78958e7..5917cb1 100644 --- a/fbs/_defaults/src/build/docker/arch/.bashrc +++ b/fbs/_defaults/src/build/docker/arch/.bashrc @@ -1,6 +1,6 @@ # Place fpm on the PATH: export PATH=$PATH:$(ruby -e "puts Gem.user_dir")/bin PS1='arch:\W$ ' -source /root/${app_name}/venv/bin/activate + # Display welcome message: [ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd \ No newline at end of file diff --git a/fbs/_defaults/src/build/docker/arch/Dockerfile b/fbs/_defaults/src/build/docker/arch/Dockerfile index 92b45f4..98edf17 100644 --- a/fbs/_defaults/src/build/docker/arch/Dockerfile +++ b/fbs/_defaults/src/build/docker/arch/Dockerfile @@ -1,27 +1,41 @@ -# Build on an old Arch version on purpose, to maximize compatibility: -FROM fmanbuildsystem/archlinux:2018.04.01 +# Build on :latest because Arch is a rolling release distribution: +FROM archlinux:latest ARG requirements -RUN echo 'Server=https://archive.archlinux.org/repos/2018/04/01/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ +# Python 3.7 is the earliest version that won't crash in Arch as of July 2021. +ARG python_version=3.7.11 +# List from https://github.com/pyenv/pyenv/wiki#suggested-build-environment: +ARG python_build_deps="base-devel openssl zlib xz git" + +RUN echo 'Server=https://mirror.rackspace.com/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ pacman -Syy -# Python 3.6: -RUN pacman -S --noconfirm python +# Install pyenv: +RUN pacman -S --noconfirm curl git +ENV PYENV_ROOT /root/.pyenv +ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH +RUN curl https://pyenv.run | bash +RUN pyenv update + +# Install Python: +RUN echo $python_build_deps | xargs pacman -S --noconfirm +RUN CONFIGURE_OPTS=--enable-shared pyenv install $python_version && \ + pyenv global $python_version && \ + pyenv rehash -# fpm: +# Install fpm: RUN pacman -S --noconfirm ruby ruby-rdoc && \ export PATH=$PATH:$(ruby -e "puts Gem.user_dir")/bin && \ gem update && \ - gem install --no-ri --no-rdoc fpm + gem install --no-document fpm WORKDIR /root/${app_name} -# Set up virtual environment: +# Install Python dependencies: ADD *.txt /tmp/requirements/ -RUN python -m venv venv && \ - venv/bin/python -m pip install --upgrade pip && \ - venv/bin/python -m pip install -r "/tmp/requirements/${requirements}" +RUN pip install --upgrade pip && \ + pip install -r "/tmp/requirements/${requirements}" RUN rm -rf /tmp/requirements/ # Welcome message, displayed by ~/.bashrc: @@ -35,4 +49,4 @@ RUN gpg -q --batch --yes --passphrase ${gpg_pass} --import /tmp/private-key.gpg rm /tmp/private-key.gpg /tmp/public-key.gpg ADD gpg-agent.conf /root/.gnupg/gpg-agent.conf -RUN gpgconf --kill gpg-agent +RUN gpgconf --kill gpg-agent \ No newline at end of file