gossa: wrap in shell script to set uid / gid
This commit is contained in:
parent
01e40935c9
commit
3dcf8305bb
2 changed files with 21 additions and 1 deletions
|
@ -5,6 +5,8 @@ FROM ${REPO_LOCATION}minideb
|
||||||
|
|
||||||
RUN install_packages gossa
|
RUN install_packages gossa
|
||||||
|
|
||||||
|
COPY "run.sh" "/srv/run.sh"
|
||||||
|
|
||||||
VOLUME /mnt
|
VOLUME /mnt
|
||||||
|
|
||||||
ENTRYPOINT [ "gossa" "-p" "5700" "/mnt" ]
|
ENTRYPOINT [ "/srv/run.sh" ]
|
||||||
|
|
18
images/gossa/run.sh
Executable file
18
images/gossa/run.sh
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ -z "${GOSSA_UID}" ]]; then
|
||||||
|
echo "Error: No target uid specified in the GOSSA_UID environment variable.";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
if [[ -z "${GOSSA_GID}" ]]; then
|
||||||
|
echo "Error: No target gid specified in the GOSSA_GID environment variable.";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
if [[ -z "${NOMAD_PORT_GOSSA}" ]]; then
|
||||||
|
echo "Error: No port number specified in the NOMAD_PORT_gossa environment variable.";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "/mnt" || { echo "Failed to cd into /mnt"; exit 1; };
|
||||||
|
|
||||||
|
setpriv --inh-caps=-all --reuid "${GOSSA_UID}" --init-groups --regid "${GOSSA_GID}" /usr/local/bin/gossa -p "${NOMAD_PORT_GOSSA}" /mnt;
|
Loading…
Reference in a new issue