Fix startup without MINIO_USERNAME and MINIO_GROUPNAME (#7944)

This commit is contained in:
Philipp Dallig 2019-07-18 18:19:50 +02:00 committed by Nitish Tiwari
parent b058e32348
commit be9baa1464

View file

@ -52,7 +52,7 @@ docker_sse_encryption_env() {
# su-exec to requested user, if service cannot run exec will fail.
docker_switch_user() {
if [ -z "${MINIO_USERNAME}" ] || [ -z "${MINIO_GROUPNAME}" ]; then
if [ ! -z "${MINIO_USERNAME}" ] && [ ! -z "${MINIO_GROUPNAME}" ]; then
addgroup -S "$MINIO_GROUPNAME" >/dev/null 2>&1 && \
adduser -S -G "$MINIO_GROUPNAME" "$MINIO_USERNAME" >/dev/null 2>&1