File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,18 @@ if [ "${1}" = "minio" ]; then
113113 # Stop temporary MinIO server.
114114 minio_stop_temp_server
115115
116- if [ -n " ${MY_UID} " ]; then
117- usermod -u " ${MY_UID} " minio
118- chown -R " ${MY_UID} " " ${BUCKET_ROOT} "
116+ if [ -n " ${MY_UID:- 0} " ] && [ " ${MY_UID:- 0} " != " 0" ]; then
117+ usermod -u " ${MY_UID:- 0} " minio
119118 fi
120- if [ -n " ${MY_GID} " ]; then
121- groupmod -g " ${MY_GID} " minio
122- chgrp -R " ${MY_GID} " " ${BUCKET_ROOT} "
119+ if [ -n " ${MY_GID:- 0} " ] && [ " ${MY_GID:- 0} " != " 0" ]; then
120+ groupmod -g " ${MY_GID:- 0} " minio
123121 fi
124122
123+ chown -R " ${MY_UID:- 0} " " ${BUCKET_ROOT} "
124+ chgrp -R " ${MY_GID:- 0} " " ${BUCKET_ROOT} "
125+
125126 # Run minio.
126- gosu " ${MY_UID:- root } :${MY_GID:- root } " /usr/bin/minio server " ${BUCKET_ROOT} " --address " :${MINIO_PORT} " --console-address " :${MINIO_CONSOLE_PORT} " ${MINIO_OPTS}
127+ gosu " ${MY_UID:- 0 } :${MY_GID:- 0 } " /usr/bin/minio server " ${BUCKET_ROOT} " --address " :${MINIO_PORT} " --console-address " :${MINIO_CONSOLE_PORT} " ${MINIO_OPTS}
127128fi
128129
129130if [ " ${1} " = " mc" ]; then
You can’t perform that action at this time.
0 commit comments