picca/docker/entrypoint.sh

18 lines
389 B
Bash
Raw Normal View History

#!/bin/sh
# Entrypoint file for picca Docker containers
if [ -z "$UID" ]; then
echo "UID not set! Setting to id $(id -u)"
export UID=$(id -u)
fi
if [ -z "$GID" ]; then
echo "GID not set! Setting to id $(id -g)"
export GID=$(id -g)
fi
addgroup -g $GID dockeruser
adduser -u $UID -G $(grep :$GID: /etc/group | awk -F: '{print $1}') -D dockeruser
su -p - dockeruser -c "picca $@"