Dockerfile aktualisiert
Some checks failed
Docker Build Smart Logic / Build amd64 & arm64 (push) Failing after 7s

This commit is contained in:
2026-02-09 13:24:02 +00:00
parent d00dd0d2d4
commit de90d4f015

View File

@@ -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"]