diff --git a/images/gossa/run.sh b/images/gossa/run.sh index 4ce9f4d..84fedab 100755 --- a/images/gossa/run.sh +++ b/images/gossa/run.sh @@ -18,6 +18,13 @@ echo "[core] Running as uid = ${GOSSA_UID} gid = ${GOSSA_GID} port = ${NOMAD_POR cd "/mnt" || { echo "Failed to cd into /mnt"; exit 1; }; -setpriv --inh-caps=-all --reuid "${GOSSA_UID}" --clear-groups --regid "${GOSSA_GID}" /usr/local/bin/gossa -h '[::]' -p "${NOMAD_PORT_GOSSA}" /mnt; + +# Ref https://github.com/SinusBot/docker/pull/40 +# WORKAROUND for `setpriv: libcap-ng is too old for "all" caps`, previously "-all" was used here +# create a list to drop all capabilities supported by current kernel +cap_prefix="-cap_"; +caps="$cap_prefix$(seq -s ",$cap_prefix" 0 "$(cat /proc/sys/kernel/cap_last_cap)")"; + +setpriv --inh-caps="${caps}" --reuid "${GOSSA_UID}" --clear-groups --regid "${GOSSA_GID}" /usr/local/bin/gossa -h '[::]' -p "${NOMAD_PORT_GOSSA}" /mnt; echo "[core] Ending";