mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
Note that this commit contains the following breaking changes: * remote pull and remote push triggers are now enabled by default (with empty target list) * remote pull and remote push triggers now require target option to be set (old behaviour had fallback on `gitremote`) * validation is now considered to be stable, so it is enabled by default in docker image (can be disabled however)
56 lines
2.3 KiB
Docker
56 lines
2.3 KiB
Docker
FROM archlinux:base
|
|
|
|
# image configuration
|
|
ENV AHRIMAN_ARCHITECTURE="x86_64"
|
|
ENV AHRIMAN_DEBUG=""
|
|
ENV AHRIMAN_FORCE_ROOT=""
|
|
ENV AHRIMAN_HOST="0.0.0.0"
|
|
ENV AHRIMAN_OUTPUT="syslog"
|
|
ENV AHRIMAN_PACKAGER="ahriman bot <ahriman@example.com>"
|
|
ENV AHRIMAN_PORT=""
|
|
ENV AHRIMAN_REPOSITORY="aur-clone"
|
|
ENV AHRIMAN_REPOSITORY_ROOT="/var/lib/ahriman/ahriman"
|
|
ENV AHRIMAN_UNIX_SOCKET=""
|
|
ENV AHRIMAN_USER="ahriman"
|
|
ENV AHRIMAN_VALIDATE_CONFIGURATION="yes"
|
|
|
|
# install environment
|
|
## update pacman.conf with multilib
|
|
RUN echo "[multilib]" >> "/etc/pacman.conf" && \
|
|
echo "Include = /etc/pacman.d/mirrorlist" >> "/etc/pacman.conf"
|
|
## 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"
|
|
COPY "docker/install-aur-package.sh" "/usr/local/bin/install-aur-package"
|
|
## install package dependencies
|
|
## 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-cerberus python-inflection python-passlib python-requests python-setuptools python-srcinfo && \
|
|
pacman --noconfirm -Sy python-build python-installer python-wheel && \
|
|
pacman --noconfirm -Sy breezy mercurial python-aiohttp python-boto3 python-cryptography python-jinja python-requests-unixsocket 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
|
|
COPY --chown=build . "/home/build/ahriman"
|
|
## create package archive and install it
|
|
RUN cd "/home/build/ahriman" && \
|
|
make VERSION=$(python -c "from src.ahriman.version import __version__; print(__version__)") archlinux && \
|
|
cp ./*-src.tar.xz "package/archlinux" && \
|
|
cd "package/archlinux" && \
|
|
runuser -u build -- makepkg --noconfirm --install --skipchecksums && \
|
|
cd / && rm -r "/home/build/ahriman"
|
|
|
|
VOLUME ["/var/lib/ahriman"]
|
|
|
|
# minimal runtime ahriman setup
|
|
COPY "docker/entrypoint.sh" "/usr/local/bin/entrypoint"
|
|
ENTRYPOINT ["entrypoint"]
|
|
# default command
|
|
CMD ["repo-update", "--refresh"]
|