Compare commits

...

6 Commits

Author SHA1 Message Date
LinuxServer-CI
86630cc696 Bot Updating Package Versions 2023-03-28 13:31:01 -05:00
aptalca
e6e49062ec Merge pull request #221 from linuxserver/piconbuild
extract picons during build
2023-03-28 14:13:23 -04:00
LinuxServer-CI
d7e8758b7d Bot Updating Package Versions 2023-03-26 10:07:35 -05:00
aptalca
a1c3f4e8a9 fix lsiown command 2023-03-17 14:01:28 -04:00
aptalca
fa7487747d Use lsiown to fix perms 2023-03-17 10:00:17 -04:00
aptalca
cf936490b9 extract picons during build 2023-03-17 09:43:24 -04:00
7 changed files with 59 additions and 71 deletions

View File

@@ -1,5 +1,10 @@
# syntax=docker/dockerfile:1
############## picons stage ##############
# built by https://github.com/linuxserver/picons-builder
FROM ghcr.io/linuxserver/picons-builder as piconsstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.17 as buildstage
############## build stage ##############
@@ -12,8 +17,9 @@ ARG TZ="Etc/UTC"
ARG TVHEADEND_COMMIT
ENV HOME="/config"
# copy patches
# copy patches and picons
COPY patches/ /tmp/patches/
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
RUN \
echo "**** install build packages ****" && \
@@ -211,10 +217,12 @@ RUN \
make -j 2 && \
make DESTDIR=/tmp/comskip-build install
############## picons stage ##############
# built by https://github.com/linuxserver/picons-builder
FROM ghcr.io/linuxserver/picons-builder as piconsstage
RUN \
echo "***** extract picons ****" && \
mkdir -p /picons && \
tar xf \
/picons.tar.bz2 -C \
/picons
############## runtime stage ##############
FROM ghcr.io/linuxserver/baseimage-alpine:3.17
@@ -313,7 +321,7 @@ COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
COPY --from=buildstage /tmp/xmltv-build/usr/ /usr/
COPY --from=buildstage /usr/local/share/man/ /usr/local/share/man/
COPY --from=buildstage /usr/local/share/perl5/ /usr/local/share/perl5/
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
COPY --from=buildstage /picons /picons
COPY root/ /
# ports and volumes

View File

@@ -1,5 +1,10 @@
# syntax=docker/dockerfile:1
############## picons stage ##############
# built by https://github.com/linuxserver/picons-builder
FROM ghcr.io/linuxserver/picons-builder as piconsstage
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.17 as buildstage
############## build stage ##############
@@ -12,8 +17,9 @@ ARG TZ="Etc/UTC"
ARG TVHEADEND_COMMIT
ENV HOME="/config"
# copy patches
# copy patches and picons
COPY patches/ /tmp/patches/
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
RUN \
echo "**** install build packages ****" && \
@@ -211,9 +217,12 @@ RUN \
make -j 2 && \
make DESTDIR=/tmp/comskip-build install
############## picons stage ##############
# built by https://github.com/linuxserver/picons-builder
FROM ghcr.io/linuxserver/picons-builder as piconsstage
RUN \
echo "***** extract picons ****" && \
mkdir -p /picons && \
tar xf \
/picons.tar.bz2 -C \
/picons
############## runtime stage ##############
@@ -311,7 +320,7 @@ COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
COPY --from=buildstage /tmp/xmltv-build/usr/ /usr/
COPY --from=buildstage /usr/local/share/man/ /usr/local/share/man/
COPY --from=buildstage /usr/local/share/perl5/ /usr/local/share/perl5/
COPY --from=piconsstage /picons.tar.bz2 /picons.tar.bz2
COPY --from=buildstage /picons /picons
COPY root/ /
# ports and volumes

View File

@@ -301,6 +301,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **17.03.23:** - Extract picons during build instead of init.
* **23.02.23:** - Rebase to Alpine 3.17, migrate to s6v3, drop armhf support.
* **31.08.22:** - Update sample env vars and how RUN_OPTS are handled.
* **19.08.22:** - Switch to new picons builder.

View File

@@ -18,10 +18,10 @@ certifi 2022.12.7 python
charset-normalizer 3.0.1 python
cjson 1.7.15-r3 apk
coreutils 9.1-r0 apk
curl 7.88.1-r0 apk
curl 7.88.1-r1 apk
dbus-libs 1.14.4-r0 apk
ffmpeg 5.1.2-r1 apk
ffmpeg-libs 5.1.2-r1 apk
ffmpeg 5.1.3-r0 apk
ffmpeg-libs 5.1.3-r0 apk
ffmpeg4-libs 4.4.3-r0 apk
flac-libs 1.4.2-r0 apk
fontconfig 2.14.1-r0 apk
@@ -49,8 +49,8 @@ libblkid 2.38.1-r1 apk
libbsd 0.11.7-r0 apk
libbz2 1.0.8-r4 apk
libc-utils 0.7.2-r3 apk
libcrypto3 3.0.8-r0 apk
libcurl 7.88.1-r0 apk
libcrypto3 3.0.8-r1 apk
libcurl 7.88.1-r1 apk
libdav1d 1.0.0-r2 apk
libdrm 2.4.114-r0 apk
libdvbcsa 1.1.0-r1 apk
@@ -76,7 +76,7 @@ libsndfile 1.1.0-r2 apk
libsodium 1.0.18-r2 apk
libsrt 1.5.1-r0 apk
libssh 0.10.4-r0 apk
libssl3 3.0.8-r0 apk
libssl3 3.0.8-r1 apk
libstdc++ 12.2.1_git20220924-r4 apk
libtasn1 4.19.0-r0 apk
libtheora 1.1.1-r16 apk
@@ -95,7 +95,7 @@ libxdmcp 1.1.4-r0 apk
libxext 1.3.5-r0 apk
libxfixes 6.0.0-r0 apk
libxml2 2.10.3-r1 apk
libxslt 1.1.37-r0 apk
libxslt 1.1.37-r1 apk
libzmq 4.3.4-r1 apk
linux-headers 5.19.5-r0 apk
linux-pam 1.5.2-r1 apk
@@ -133,7 +133,7 @@ perl-date-manip 6.89-r0 apk
perl-datetime 1.59-r0 apk
perl-datetime-format-strptime 1.79-r0 apk
perl-datetime-locale 1.37-r0 apk
perl-datetime-timezone 2.56-r0 apk
perl-datetime-timezone 2.59-r0 apk
perl-dbd-sqlite 1.72-r0 apk
perl-dbi 1.643-r4 apk
perl-devel-stacktrace 2.04-r3 apk
@@ -255,7 +255,7 @@ sqlite-libs 3.40.1-r0 apk
ssl_client 1.35.0-r29 apk
svt-av1-libs 1.3.0-r0 apk
tdb-libs 1.4.7-r0 apk
tzdata 2022f-r1 apk
tzdata 2023b-r1 apk
uriparser 0.9.7-r0 apk
urllib3 1.26.12 python
utmps-libs 0.1.2.0-r1 apk

View File

@@ -123,6 +123,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "17.03.23:", desc: "Extract picons during build instead of init." }
- { date: "23.02.23:", desc: "Rebase to Alpine 3.17, migrate to s6v3, drop armhf support." }
- { date: "31.08.22:", desc: "Update sample env vars and how RUN_OPTS are handled." }
- { date: "19.08.22:", desc: "Switch to new picons builder." }

View File

@@ -3,50 +3,19 @@
# make folders
mkdir -p \
/config/comskip
/config/comskip
# copy config
if [[ ! -e /config/dvr/config ]]; then
(mkdir -p /config/dvr/config && cp /defaults/7a5edfbe189851e5b1d1df19c93962f0 /config/dvr/config/7a5edfbe189851e5b1d1df19c93962f0)
(mkdir -p /config/dvr/config && cp /defaults/7a5edfbe189851e5b1d1df19c93962f0 /config/dvr/config/7a5edfbe189851e5b1d1df19c93962f0)
fi
if [[ ! -e /config/comskip/comskip.ini ]]; then
cp /defaults/comskip.ini.org /config/comskip/comskip.ini
cp /defaults/comskip.ini.org /config/comskip/comskip.ini
fi
if [[ ! -e /config/config ]]; then
(cp /defaults/config /config/config)
fi
# extract picons on first run
if [[ -f /picons.tar.bz2 ]]; then
mkdir -p /picons
tar xf \
/picons.tar.bz2 -C \
/picons &&
rm -f /picons.tar.bz2
fi
# function to randomly sample 5 files for their owner and only chown if not abc
chowner () {
files=(${1}/*)
for i in {1..5}; do
user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}"))
if [ "${user}" != "abc" ]; then
chown -R abc:abc ${1}
break
fi
done
}
# permissions
echo "Setting permissions"
abc_dirs=( \
/config \
/picons \
)
for i in "${abc_dirs[@]}"; do
if [ "$(ls -A ${i})" ]; then
chowner ${i}
else
chown -R abc:abc ${i}
fi
done
lsiown -R abc:abc /config

View File

@@ -5,23 +5,23 @@ FILES=$(find /dev/dri /dev/dvb -type c -print 2>/dev/null)
for i in $FILES
do
VIDEO_GID=$(stat -c '%g' "$i")
if id -G abc | grep -qw "$VIDEO_GID"; then
touch /groupadd
else
if [ ! "${VIDEO_GID}" == '0' ]; then
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-z0-9' | head -c8)"
groupadd "$VIDEO_NAME"
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
fi
usermod -a -G "$VIDEO_NAME" abc
touch /groupadd
fi
fi
VIDEO_GID=$(stat -c '%g' "$i")
if id -G abc | grep -qw "$VIDEO_GID"; then
touch /groupadd
else
if [ ! "${VIDEO_GID}" == '0' ]; then
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
if [ -z "${VIDEO_NAME}" ]; then
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-z0-9' | head -c8)"
groupadd "$VIDEO_NAME"
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
fi
usermod -a -G "$VIDEO_NAME" abc
touch /groupadd
fi
fi
done
if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then
usermod -a -G root abc
usermod -a -G root abc
fi