POC for building rootfs without external scripts

This commit is contained in:
TheSpad 2023-01-07 11:31:51 +00:00
parent 421e194812
commit f09bf380e9
No known key found for this signature in database
GPG key ID: 08F06191F4587860
5 changed files with 45 additions and 52 deletions

View file

@ -0,0 +1,12 @@
name: Comment on invalid interaction
on:
issues:
types:
- labeled
jobs:
add-comment-on-invalid:
if: github.event.label.name == 'invalid'
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/invalid-interaction-helper.yml@v1
secrets: inherit

View file

@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM alpine:3.17 as rootfs-stage FROM alpine:3 as rootfs-stage
# environment # environment
ENV ROOTFS=/root-out
ENV REL=edge ENV REL=edge
ENV ARCH=x86_64 ENV ARCH=x86_64
ENV MIRROR=http://dl-cdn.alpinelinux.org/alpine ENV MIRROR=http://dl-cdn.alpinelinux.org/alpine
@ -10,29 +11,22 @@ ENV PACKAGES=alpine-baselayout,\
alpine-keys,\ alpine-keys,\
apk-tools,\ apk-tools,\
busybox,\ busybox,\
libc-utils,\ libc-utils
xz
# install packages # install packages
RUN \ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
curl \
tzdata \
xz xz
# fetch builder script from gliderlabs # build rootfs
RUN \ RUN \
curl -o \ mkdir -p "$ROOTFS/etc/apk" && \
/mkimage-alpine.bash -L \ { \
https://raw.githubusercontent.com/gliderlabs/docker-alpine/master/builder/scripts/mkimage-alpine.bash && \ echo "$MIRROR/$REL/main"; \
chmod +x \ echo "$MIRROR/$REL/community"; \
/mkimage-alpine.bash && \ } > "$ROOTFS/etc/apk/repositories" && \
./mkimage-alpine.bash && \ apk --root "$ROOTFS" --no-cache --keys-dir /etc/apk/keys add --arch $ARCH --initdb ${PACKAGES//,/ } && \
mkdir /root-out && \
tar xf \
/rootfs.tar.xz -C \
/root-out && \
sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow
# set version for s6 overlay # set version for s6 overlay
@ -78,7 +72,6 @@ RUN \
coreutils \ coreutils \
curl \ curl \
jq \ jq \
procps \
shadow \ shadow \
tzdata && \ tzdata && \
echo "**** create abc user and make our folders ****" && \ echo "**** create abc user and make our folders ****" && \

View file

@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM alpine:3.17 as rootfs-stage FROM alpine:3 as rootfs-stage
# environment # environment
ENV ROOTFS=/root-out
ENV REL=edge ENV REL=edge
ENV ARCH=aarch64 ENV ARCH=aarch64
ENV MIRROR=http://dl-cdn.alpinelinux.org/alpine ENV MIRROR=http://dl-cdn.alpinelinux.org/alpine
@ -10,29 +11,22 @@ ENV PACKAGES=alpine-baselayout,\
alpine-keys,\ alpine-keys,\
apk-tools,\ apk-tools,\
busybox,\ busybox,\
libc-utils,\ libc-utils
xz
# install packages # install packages
RUN \ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
curl \
tzdata \
xz xz
# fetch builder script from gliderlabs # build rootfs
RUN \ RUN \
curl -o \ mkdir -p "$ROOTFS/etc/apk" && \
/mkimage-alpine.bash -L \ { \
https://raw.githubusercontent.com/gliderlabs/docker-alpine/master/builder/scripts/mkimage-alpine.bash && \ echo "$MIRROR/$REL/main"; \
chmod +x \ echo "$MIRROR/$REL/community"; \
/mkimage-alpine.bash && \ } > "$ROOTFS/etc/apk/repositories" && \
./mkimage-alpine.bash && \ apk --root "$ROOTFS" --no-cache --keys-dir /etc/apk/keys add --arch $ARCH --initdb ${PACKAGES//,/ } && \
mkdir /root-out && \
tar xf \
/rootfs.tar.xz -C \
/root-out && \
sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow
# set version for s6 overlay # set version for s6 overlay

View file

@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM alpine:3.17 as rootfs-stage FROM alpine:3 as rootfs-stage
# environment # environment
ENV ROOTFS=/root-out
ENV REL=edge ENV REL=edge
ENV ARCH=armv7 ENV ARCH=armv7
ENV MIRROR=http://dl-cdn.alpinelinux.org/alpine ENV MIRROR=http://dl-cdn.alpinelinux.org/alpine
@ -10,29 +11,22 @@ ENV PACKAGES=alpine-baselayout,\
alpine-keys,\ alpine-keys,\
apk-tools,\ apk-tools,\
busybox,\ busybox,\
libc-utils,\ libc-utils
xz
# install packages # install packages
RUN \ RUN \
apk add --no-cache \ apk add --no-cache \
bash \ bash \
curl \
tzdata \
xz xz
# fetch builder script from gliderlabs # build rootfs
RUN \ RUN \
curl -o \ mkdir -p "$ROOTFS/etc/apk" && \
/mkimage-alpine.bash -L \ { \
https://raw.githubusercontent.com/gliderlabs/docker-alpine/master/builder/scripts/mkimage-alpine.bash && \ echo "$MIRROR/$REL/main"; \
chmod +x \ echo "$MIRROR/$REL/community"; \
/mkimage-alpine.bash && \ } > "$ROOTFS/etc/apk/repositories" && \
./mkimage-alpine.bash && \ apk --root "$ROOTFS" --no-cache --keys-dir /etc/apk/keys add --arch $ARCH --initdb ${PACKAGES//,/ } && \
mkdir /root-out && \
tar xf \
/rootfs.tar.xz -C \
/root-out && \
sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow sed -i -e 's/^root::/root:!:/' /root-out/etc/shadow
# set version for s6 overlay # set version for s6 overlay

View file

@ -52,6 +52,6 @@ Apps will not behave correctly without this
sleep infinity sleep infinity
fi fi
chown abc:abc /app lsiown abc:abc /app
chown abc:abc /config lsiown abc:abc /config
chown abc:abc /defaults lsiown abc:abc /defaults