Base Image: S6 overlay & jemalloc update (#72425)

* Update base image with new s6-Overlay & jemalloc

* add build version

* Update finish
This commit is contained in:
Pascal Vizeli
2022-05-24 15:51:06 +02:00
committed by GitHub
parent 23bd64b7a2
commit 6368df5e37
4 changed files with 75 additions and 43 deletions

View File

@@ -1,23 +1,49 @@
#!/bin/execlineb -S0
#!/usr/bin/env bashio
##
## load default PATH (the same that Docker includes if not provided) if it doesn't exist,
## then go ahead with stage1.
## this was motivated due to this issue:
## - https://github.com/just-containers/s6-overlay/issues/108
##
# This is the first program launched at container start.
# We don't know where our binaries are and we cannot guarantee
# that the default PATH can access them.
# So this script needs to be entirely self-contained until it has
# at least /command, /usr/bin and /bin in its PATH.
/bin/importas -D /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH PATH
export PATH ${PATH}
##
## Skip further init if the user has a given CMD.
## This is to prevent Home Assistant from starting twice if the user
## decided to override/start via the CMD.
##
ifelse { s6-test $# -ne 0 }
{
$@
addpath () {
x="$1"
IFS=:
set -- $PATH
IFS=
while test "$#" -gt 0 ; do
if test "$1" = "$x" ; then
return
fi
shift
done
PATH="${x}:$PATH"
}
/etc/s6/init/init-stage1 $@
if test -z "$PATH" ; then
PATH=/bin
fi
addpath /bin
addpath /usr/bin
addpath /command
export PATH
# Now we're good: s6-overlay-suexec is accessible via PATH, as are
# all our binaries.
# Skip further init if the user has a given CMD.
# This is to prevent Home Assistant from starting twice if the user
# decided to override/start via the CMD.
if test $# -ne 0 ; then
exec "$@"
fi
# Run preinit as root, then run stage0 as the container's user (can be
# root, can be a normal user).
exec s6-overlay-suexec \
' /package/admin/s6-overlay-@VERSION@/libexec/preinit' \
'' \
/package/admin/s6-overlay-@VERSION@/libexec/stage0 \
"$@"