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

test multiarch Dockerfile
This commit is contained in:
2026-02-04 23:34:32 +00:00
parent 340b5bbab3
commit 1cce5cfa6d

View File

@@ -2,38 +2,35 @@
FROM alpine:3.23 AS rootfs-stage FROM alpine:3.23 AS rootfs-stage
ARG TARGETARCH
ARG S6_OVERLAY_VERSION="3.2.2.0" ARG S6_OVERLAY_VERSION="3.2.2.0"
ARG ROOTFS=/root-out ARG ROOTFS=/root-out
ARG REL=v3.23 ARG REL=v3.23
ARG ARCH=x86_64
ARG MIRROR=http://dl-cdn.alpinelinux.org/alpine ARG MIRROR=http://dl-cdn.alpinelinux.org/alpine
ARG PACKAGES=alpine-baselayout,\ ARG PACKAGES=alpine-baselayout,alpine-keys,apk-tools,busybox,libc-utils
alpine-keys,\
apk-tools,\
busybox,\
libc-utils
# install packages RUN apk add --no-cache bash xz curl ca-certificates
RUN \
apk add --no-cache \ # map arch
bash \ RUN case "${TARGETARCH}" in \
xz amd64) echo "x86_64" > /arch ;; \
arm64) echo "aarch64" > /arch ;; \
*) echo "unsupported arch" && exit 1 ;; \
esac
# build rootfs # build rootfs
RUN \ RUN mkdir -p "${ROOTFS}/etc/apk" && \
mkdir -p "${ROOTFS}/etc/apk" && \ echo "${MIRROR}/${REL}/main" > "${ROOTFS}/etc/apk/repositories" && \
{ \ echo "${MIRROR}/${REL}/community" >> "${ROOTFS}/etc/apk/repositories" && \
echo "${MIRROR}/${REL}/main"; \ apk --root "${ROOTFS}" --no-cache --initdb ${PACKAGES//,/ } && \
echo "${MIRROR}/${REL}/community"; \ sed -i 's/^root::/root:!:/' "${ROOTFS}/etc/shadow"
} > "${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 # s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp RUN ARCH="$(cat /arch)" && \
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/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 | tar -C "${ROOTFS}" -Jxpf - && \
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${ARCH}.tar.xz curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.xz \
| tar -C "${ROOTFS}" -Jxpf -
# add s6 optional symlinks # 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 ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp