From f443300f7084ae679183fa9920befa942c96798d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 16 Dec 2025 22:53:30 +0100 Subject: [PATCH] Used PKGMGR as Basis for infinito.nexus --- Dockerfile | 81 +++++++++++++++++++++--------------------------------- Makefile | 3 ++ 2 files changed, 34 insertions(+), 50 deletions(-) diff --git a/Dockerfile b/Dockerfile index 780b236c..fdac5794 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,60 +1,41 @@ -FROM archlinux:latest +# syntax=docker/dockerfile:1 -# 1) Pakete inkl. docker (damit docker CLI im Container vorhanden ist) -RUN pacman -Syu --noconfirm \ - base-devel \ - git \ - python \ - python-pip \ - python-setuptools \ - alsa-lib \ - go \ - rsync \ - docker \ - && pacman -Scc --noconfirm +ARG DISTRO=arch -# 2) systemctl & yay stubben -RUN printf '#!/bin/sh\nexit 0\n' > /usr/bin/systemctl \ - && chmod +x /usr/bin/systemctl \ - && printf '#!/bin/sh\nexit 0\n' > /usr/bin/yay \ - && chmod +x /usr/bin/yay +ARG PKGMGR_IMAGE_OWNER=kevinveenbirkenbach +ARG PKGMGR_IMAGE_TAG=stable +ARG PKGMGR_IMAGE="ghcr.io/${PKGMGR_IMAGE_OWNER}/pkgmgr-${DISTRO}:${PKGMGR_IMAGE_TAG}" -# 3) python-simpleaudio aus AUR -RUN useradd -m aur_builder \ - && su aur_builder -c "git clone https://aur.archlinux.org/python-simpleaudio.git /home/aur_builder/psa && \ - cd /home/aur_builder/psa && \ - makepkg --noconfirm --skippgpcheck" \ - && pacman -U --noconfirm /home/aur_builder/psa/*.pkg.tar.zst \ - && rm -rf /home/aur_builder/psa +FROM ${PKGMGR_IMAGE} AS infinito +SHELL ["/bin/bash", "-lc"] -# 4) pkgmgr + venv -ENV PKGMGR_REPO=/opt/package-manager \ - PKGMGR_VENV=/root/.venvs/pkgmgr +RUN cat /etc/os-release || true -RUN git clone https://github.com/kevinveenbirkenbach/package-manager.git $PKGMGR_REPO \ - && python -m venv $PKGMGR_VENV \ - && $PKGMGR_VENV/bin/pip install --upgrade pip \ - && $PKGMGR_VENV/bin/pip install --no-cache-dir -r $PKGMGR_REPO/requirements.txt ansible \ - && printf '#!/bin/sh\n. %s/bin/activate\nexec python %s/main.py "$@"\n' \ - "$PKGMGR_VENV" "$PKGMGR_REPO" > /usr/local/bin/pkgmgr \ - && chmod +x /usr/local/bin/pkgmgr - -ENV PATH="$PKGMGR_VENV/bin:/root/.local/bin:${PATH}" - -# 6) Infinito.Nexus Quelle rein +# ------------------------------------------------------------ +# Infinito.Nexus source in +# ------------------------------------------------------------ COPY . /opt/infinito-src -# 7) Infinito via pkgmgr (shallow) -RUN pkgmgr install infinito --clone-mode shallow +# ------------------------------------------------------------ +# Install infinito via pkgmgr (shallow) +# ------------------------------------------------------------ +RUN set -euo pipefail; \ + pkgmgr install infinito --clone-mode shallow -# 8) Override mit lokaler Quelle -RUN INFINITO_PATH=$(pkgmgr path infinito) && \ - rm -rf "$INFINITO_PATH"/* && \ - rsync -a --delete --exclude='.git' /opt/infinito-src/ "$INFINITO_PATH"/ +# ------------------------------------------------------------ +# Override with local source +# ------------------------------------------------------------ +RUN set -euo pipefail; \ + INFINITO_PATH="$(pkgmgr path infinito)"; \ + rm -rf "${INFINITO_PATH:?}/"*; \ + rsync -a --delete --exclude='.git' /opt/infinito-src/ "${INFINITO_PATH}/" -# 9) Symlink -RUN INFINITO_PATH=$(pkgmgr path infinito) && \ - ln -sf "$INFINITO_PATH"/main.py /usr/local/bin/infinito && \ - chmod +x /usr/local/bin/infinito +# ------------------------------------------------------------ +# Symlink entry +# ------------------------------------------------------------ +RUN set -euo pipefail; \ + INFINITO_PATH="$(pkgmgr path infinito)"; \ + ln -sf "${INFINITO_PATH}/main.py" /usr/local/bin/infinito; \ + chmod +x /usr/local/bin/infinito -CMD sh -c "infinito --help && exec tail -f /dev/null" +CMD ["bash", "-lc", "infinito --help && exec tail -f /dev/null"] diff --git a/Makefile b/Makefile index bed950f2..21c01ca6 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,9 @@ tree: mig: list tree @echo "Creating meta data for meta infinity graph" +make build: + docker build --network=host -t infinito:latest . + dockerignore: @echo "Create dockerignore" cat .gitignore > .dockerignore