diff --git a/Dockerfile b/Dockerfile index c69a7a68..8449fb3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM archlinux:base-devel +FROM archlinux:base # image configuration ENV AHRIMAN_ARCHITECTURE="x86_64" @@ -13,24 +13,22 @@ ENV AHRIMAN_REPOSITORY_ROOT="/var/lib/ahriman/ahriman" ENV AHRIMAN_USER="ahriman" # install environment -## install git which is required for AUR interaction and go for yay -RUN pacman --noconfirm -Syu git go +## install minimal required packages +RUN pacman --noconfirm -Syu binutils fakeroot git make sudo ## create build user RUN useradd -m -d /home/build -s /usr/bin/nologin build && \ echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/build -## install AUR helper -RUN YAY_DIR="$(runuser -u build -- mktemp -d)" && \ - git clone https://aur.archlinux.org/yay.git "$YAY_DIR" && \ - cd "$YAY_DIR" && \ - runuser -u build -- makepkg --noconfirm --install && \ - cd - && rm -r "$YAY_DIR" +COPY "docker/install-aur-package.sh" "/usr/local/bin/install-aur-package" ## install package dependencies -RUN runuser -u build -- yay --noconfirm -Sy devtools git pyalpm python-inflection python-passlib python-requests python-srcinfo && \ - runuser -u build -- yay --noconfirm -Sy python-build python-installer python-wheel && \ - runuser -u build -- yay --noconfirm -Sy breezy darcs mercurial python-aioauth-client python-aiohttp \ - python-aiohttp-debugtoolbar python-aiohttp-jinja2 python-aiohttp-security \ - python-aiohttp-session python-boto3 python-cryptography python-jinja \ - rsync subversion +## darcs is not installed by reasons, because it requires a lot haskell packages which dramatically increase image size +RUN pacman --noconfirm -Sy devtools git pyalpm python-inflection python-passlib python-requests python-srcinfo && \ + pacman --noconfirm -Sy python-build python-installer python-wheel && \ + pacman --noconfirm -Sy breezy mercurial python-aiohttp python-boto3 python-cryptography python-jinja rsync subversion && \ + runuser -u build -- install-aur-package python-aioauth-client python-aiohttp-jinja2 python-aiohttp-debugtoolbar \ + python-aiohttp-session python-aiohttp-security + +# cleanup unused +RUN find "/var/cache/pacman/pkg" -type f -delete # install ahriman ## copy tree @@ -41,7 +39,7 @@ RUN cd "/home/build/ahriman" && \ cp ./*-src.tar.xz "package/archlinux" && \ cd "package/archlinux" && \ runuser -u build -- makepkg --noconfirm --install --skipchecksums && \ - cd - && rm -r "/home/build/ahriman" + cd / && rm -r "/home/build/ahriman" VOLUME ["/var/lib/ahriman"] diff --git a/README.md b/README.md index 2b353e7b..3526a767 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,6 @@ For installation details kindly refer to the [documentation](https://ahriman.rea Every available option is described in the [documentation](https://ahriman.readthedocs.io/en/latest/configuration.html). -The application provides reasonable defaults which allow to use it out-of-box, though additional steps (like configuring build toolchain and sudoers) is recommended and can be easily achieved by following install instructions. +The application provides reasonable defaults which allow to use it out-of-box; however additional steps (like configuring build toolchain and sudoers) are recommended and can be easily achieved by following install instructions. ## [FAQ](https://ahriman.readthedocs.io/en/latest/faq.html) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index de828a3a..fd12dbc5 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -33,7 +33,7 @@ fi ahriman "${AHRIMAN_DEFAULT_ARGS[@]}" repo-setup "${AHRIMAN_SETUP_ARGS[@]}" # refresh database -runuser -u build -- yay --noconfirm -Syy &> /dev/null +pacman -Syy &> /dev/null # create machine-id which is required by build tools systemd-machine-id-setup &> /dev/null diff --git a/docker/install-aur-package.sh b/docker/install-aur-package.sh new file mode 100755 index 00000000..5d4f491c --- /dev/null +++ b/docker/install-aur-package.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +for PACKAGE in "$@"; do + BUILD_DIR="$(mktemp -d)" + git clone https://aur.archlinux.org/"$PACKAGE".git "$BUILD_DIR" + cd "$BUILD_DIR" + makepkg --noconfirm --install --rmdeps --syncdeps + cd / + rm -r "$BUILD_DIR" +done diff --git a/docs/ahriman.core.rst b/docs/ahriman.core.rst index 56e6eabb..691cd58c 100644 --- a/docs/ahriman.core.rst +++ b/docs/ahriman.core.rst @@ -38,6 +38,14 @@ ahriman.core.exceptions module :no-undoc-members: :show-inheritance: +ahriman.core.lazy\_logging module +--------------------------------- + +.. automodule:: ahriman.core.lazy_logging + :members: + :no-undoc-members: + :show-inheritance: + ahriman.core.spawn module ------------------------- diff --git a/docs/faq.rst b/docs/faq.rst index 10e9796d..a43aa067 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -240,7 +240,7 @@ The default action (in case if no arguments provided) is ``repo-update``. Basica docker run -v /path/to/local/repo:/var/lib/ahriman -v /etc/ahriman.ini:/etc/ahriman.ini.d/10-overrides.ini arcan1s/ahriman:latest -By default, it runs ``repo-update``, but it can be overwritten to any other command you would like to, e.g.: +The action can be specified during run, e.g.: .. code-block:: shell