Dockerfile.aarch64
Some checks failed
/ release-and-build (push) Failing after 1m12s

This commit is contained in:
2026-03-16 17:16:37 +01:00
parent 5f7be6746a
commit 6a326a81ba
3 changed files with 167 additions and 27 deletions

166
Dockerfile.aarch64 Normal file
View File

@@ -0,0 +1,166 @@
# syntax=docker/dockerfile:1
FROM alpine:3 AS rootfs-stage
ARG BUILD_APP_VERSION
ARG BUILD_S6_ARCH_aarch64
ARG BUILD_S6_OVERLAY_VERSION
ARG ROOTFS=/root-out
ARG BUILD_DEBIAN_REL
ARG BUILD_DEBIAN_ARCH_AARCH64
ARG MIRROR=http://dl-cdn.alpinelinux.org/alpine
ARG PACKAGES=alpine-baselayout,\
alpine-keys,\
apk-tools,\
busybox,\
libc-utils
# install packages
# install packages
RUN \
apk add --no-cache \
bash \
curl \
tzdata \
xz
# grab base tarball
RUN \
mkdir /root-out && \
curl -o \
/rootfs.tar.gz -L \
https://github.com/debuerreotype/docker-debian-artifacts/raw/refs/heads/dist-${BUILD_DEBIAN_ARCH_AARCH64}}/${BUILD_DEBIAN_REL}/slim/oci/blobs/rootfs.tar.gz && \
tar xf \
/rootfs.tar.gz -C \
/root-out && \
rm -rf \
/root-out/var/log/*
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${BUILD_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${BUILD_S6_OVERLAY_VERSION}/s6-overlay-${BUILD_S6_ARCH_aarch64}.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${BUILD_S6_ARCH_aarch64}.tar.xz
# add s6 optional symlinks
ADD https://github.com/just-containers/s6-overlay/releases/download/v${BUILD_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${BUILD_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 BUILD_APP_VERSION
ARG MODS_VERSION="v3"
ARG PKG_INST_VERSION="v1"
ARG LSIOWN_VERSION="v1"
ARG WITHCONTENV_VERSION="v1"
ARG BUILD_APP_GID
ARG BUILD_APP_USER
ARG BUILD_MAINTAINER
LABEL build_version="${BUILD_MAINTAINER} version: ${BUILD_APP_VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="${BUILD_MAINTAINER}"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
ADD --chmod=744 "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=744 "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"
# set environment variables
ARG DEBIAN_FRONTEND="noninteractive"
ENV HOME="/root" \
LANGUAGE="en_US.UTF-8" \
LANG="en_US.UTF-8" \
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 "**** Ripped from Ubuntu Docker Logic ****" && \
echo '#!/bin/sh' \
> /usr/sbin/policy-rc.d && \
echo 'exit 101' \
>> /usr/sbin/policy-rc.d && \
chmod +x \
/usr/sbin/policy-rc.d && \
dpkg-divert --local --rename --add /sbin/initctl && \
cp -a \
/usr/sbin/policy-rc.d \
/sbin/initctl && \
sed -i \
's/^exit.*/exit 0/' \
/sbin/initctl && \
echo 'force-unsafe-io' \
> /etc/dpkg/dpkg.cfg.d/docker-apt-speedup && \
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \
> /etc/apt/apt.conf.d/docker-clean && \
echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' \
>> /etc/apt/apt.conf.d/docker-clean && \
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' \
>> /etc/apt/apt.conf.d/docker-clean && \
echo 'Acquire::Languages "none";' \
> /etc/apt/apt.conf.d/docker-no-languages && \
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' \
> /etc/apt/apt.conf.d/docker-gzip-indexes && \
echo 'Apt::AutoRemove::SuggestsImportant "false";' \
> /etc/apt/apt.conf.d/docker-autoremove-suggests && \
mkdir -p /run/systemd && \
echo 'docker' \
> /run/systemd/container && \
echo "**** install apt-utils and locales ****" && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
apt-utils \
locales && \
echo "**** install packages ****" && \
apt-get install -y \
catatonit \
cron \
curl \
gnupg \
jq \
netcat-traditional \
tzdata && \
echo "**** add all sources ****" && \
echo "deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian trixie main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://deb.debian.org/debian trixie-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian trixie-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb http://security.debian.org/debian-security/ trixie-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb-src http://security.debian.org/debian-security/ trixie-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
rm -f /etc/apt/sources.list.d/debian.sources && \
echo "**** generate locale ****" && \
locale-gen en_US.UTF-8 && \
echo "**** create abc user and make our folders ****" && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p \
/app \
/config \
/defaults \
/lsiopy && \
echo "**** cleanup ****" && \
apt-get -y autoremove && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/* \
/var/log/* \
/usr/share/man
# add local files
COPY root/ /
ENTRYPOINT ["/init"]

View File

@@ -1,27 +0,0 @@
# Example Dockerfile for arm64
ARG BASE_IMAGE=alpine:latest
FROM ${BASE_IMAGE}
ARG MAINTAINER
ARG TZ
ARG APP_NAME
ARG APP_USER
LABEL maintainer="${MAINTAINER}"
LABEL org.opencontainers.image.title="${APP_NAME}"
ENV TZ=${TZ}
ENV USER=${APP_USER}
RUN apk add --no-cache tzdata ca-certificates
WORKDIR /app
COPY ./config /app/config
COPY ./data /app/data
RUN adduser -D ${APP_USER} && chown -R ${APP_USER}:${APP_USER} /app
USER ${APP_USER}
CMD ["sh"]

View File

@@ -7,6 +7,7 @@ BUILD_BASE_IMAGE=alpine:${BUILD_BASE_TAG}
BUILD_ALPINE_ARCH_AMD64=x86_64 BUILD_ALPINE_ARCH_AMD64=x86_64
BUILD_ALPINE_ARCH_AARCH64=aarch64 BUILD_ALPINE_ARCH_AARCH64=aarch64
BUILD_DEBIAN_ARCH=amd64 BUILD_DEBIAN_ARCH=amd64
BUILD_DEBIAN_ARCH_AARCH64=arm64v8
BUILD_DEBIAN_REL=trixie BUILD_DEBIAN_REL=trixie
BUILD_S6_ARCH_amd64=x86_64 BUILD_S6_ARCH_amd64=x86_64
BUILD_S6_ARCH_aarch64=aarch64 BUILD_S6_ARCH_aarch64=aarch64