init
Some checks failed
/ release-and-build (push) Failing after 19s

This commit is contained in:
2026-02-12 15:18:48 +01:00
parent 1b67a70488
commit 14a1792b69
71 changed files with 445 additions and 56 deletions

View File

@@ -1,34 +1,104 @@
# Example Dockerfile for arm64
# 1. ARGs vor FROM deklarieren (für das Basis-Image)
ARG BASE_IMAGE=alpine:latest
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=alpine:latest #Fallback alpine:latest
FROM ${BASE_IMAGE}
FROM ${BASE_IMAGE} AS rootfs-stage
# 2. ARGs nach FROM erneut deklarieren (für die Verwendung im Build)
ARG MAINTAINER
ARG TZ
ARG APP_NAME
ARG APP_USER
ARG APP_VERSION=${BUILD_TAG}
ARG S6_OVERLAY_VERSION=${S6_OVERLAY_VERSION}
ARG ROOTFS=/root-out
ARG REL=${APP_VERSION}
ARG ARCH=aarch64
ARG MIRROR=http://dl-cdn.alpinelinux.org/alpine
ARG PACKAGES=alpine-baselayout,\
alpine-keys,\
apk-tools,\
busybox,\
libc-utils
# Metadaten setzen
# install packages
RUN \
apk add --no-cache \
bash \
xz
# 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
# 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="${MAINTAINER} version: ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="${MAINTAINER}"
LABEL org.opencontainers.image.title="${APP_NAME}"
# Umgebungsvariablen im Container setzen
ENV TZ=${TZ}
ENV USER=${APP_USER}
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"
# Basis-System Update (Beispiel für Alpine)
RUN apk add --no-cache tzdata ca-certificates
# 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"
# Verzeichnisse aus dem Template vorbereiten
WORKDIR /app
COPY ./config /app/config
COPY ./data /app/data
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 ${APP_GID} users && \
useradd -u 911 -U -d /config -s /bin/false ${APP_USER} && \
usermod -G users ${APP_USER} && \
mkdir -p \
/app \
/config \
/defaults \
/lsiopy && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
# Beispiel: User anlegen
RUN adduser -D ${APP_USER} && chown -R ${APP_USER}:${APP_USER} /app
# add local files
COPY root/ /
USER ${APP_USER}
CMD ["sh"]
ENTRYPOINT ["/init"]