From de90d4f0157eb60cf7b952a8e86b59c6db9ef6b4 Mon Sep 17 00:00:00 2001 From: "info@pi-farm.de" Date: Mon, 9 Feb 2026 13:24:02 +0000 Subject: [PATCH] Dockerfile aktualisiert --- Dockerfile | 110 +++++++---------------------------------------------- 1 file changed, 13 insertions(+), 97 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1ac931..93d7bc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,102 +1,18 @@ -# syntax=docker/dockerfile:1 +FROM alpine:latest -FROM alpine:3.23 AS rootfs-stage +# Abhängigkeiten installieren +RUN apk add --no-cache bash curl jq msmtp ca-certificates tzdata git -ARG S6_OVERLAY_VERSION="3.2.2.0" -ARG ROOTFS=/root-out -ARG REL=v3.23 -ARG ARCH=x86_64 -ARG MIRROR=http://dl-cdn.alpinelinux.org/alpine -ARG PACKAGES=alpine-baselayout,\ -alpine-keys,\ -apk-tools,\ -busybox,\ -libc-utils +# Struktur anlegen +RUN mkdir /app /config +WORKDIR /app -# install packages -RUN \ - apk add --no-cache \ - bash \ - xz +# Skript kopieren +COPY multi-watch.sh /app/multi-watch.sh +RUN chmod +x /app/multi-watch.sh -# build rootfs -RUN \ - mkdir -p "${ROOTFS}/etc/apk" && \ - { \ - echo "${MIRROR}/${REL}/main"; \ - echo "${MIRROR}/${REL}/community"; \ - } > "${ROOTFS}/etc/apk/repositories" && \ - apk --root "${ROOTFS}" --no-cache --keys-dir /etc/apk/keys add --arch ${ARCH} --initdb ${PACKAGES//,/ } && \ - sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow +# VOLUME markiert den Mount-Punkt für die Persistenz +VOLUME ["/config"] -# add s6 overlay -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${ARCH}.tar.xz - -# add s6 optional symlinks -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && unlink /root-out/usr/bin/with-contenv -ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp -RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz - -# Runtime stage -FROM scratch -COPY --from=rootfs-stage /root-out/ / -ARG BUILD_DATE -ARG VERSION -ARG MODS_VERSION="v3" -ARG PKG_INST_VERSION="v1" -ARG LSIOWN_VERSION="v1" -ARG WITHCONTENV_VERSION="v1" -LABEL build_version="Pi-Farm version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="Pi-Farm" - -ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" -ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" -ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" -ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/with-contenv.${WITHCONTENV_VERSION}" "/usr/bin/with-contenv" - -# environment variables -ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \ - HOME="/root" \ - TERM="xterm" \ - S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \ - S6_VERBOSITY=1 \ - S6_STAGE2_HOOK=/docker-mods \ - VIRTUAL_ENV=/lsiopy \ - PATH="/lsiopy/bin:$PATH" - -RUN \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - alpine-release \ - bash \ - ca-certificates \ - catatonit \ - coreutils \ - curl \ - findutils \ - jq \ - netcat-openbsd \ - procps-ng \ - shadow \ - tzdata && \ - echo "**** create abc user and make our folders ****" && \ - groupmod -g 1000 users && \ - useradd -u 911 -U -d /config -s /bin/false abc && \ - usermod -G users abc && \ - mkdir -p \ - /app \ - /config \ - /defaults \ - /lsiopy && \ - echo "**** cleanup ****" && \ - rm -rf \ - /tmp/* - -# add local files -COPY root/ / - -ENTRYPOINT ["/init"] +# Startbefehl +ENTRYPOINT ["/bin/bash", "/app/multi-watch.sh"] \ No newline at end of file