1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00
dragonflydb-dragonfly/tools/docker/entrypoint.sh
2022-02-25 20:19:01 +02:00

15 lines
296 B
Bash
Executable file

#!/bin/sh
set -e
# first arg is `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- dragonfly "$@"
fi
# allow the docker container to be started with `--user`
if [ "$1" = 'dragonfly' -a "$(id -u)" = '0' ]; then
exec su-exec dfly "$0" "$@" # runs this script under user dfly
fi
exec "$@"