add environment var to explicitly indicate containerized and allow running as root (#1327)

This commit is contained in:
matt robinson 2016-04-18 19:30:11 -04:00 committed by Harshavardhana
parent b47d722d8e
commit af907a35a9
2 changed files with 6 additions and 0 deletions

View file

@ -5,4 +5,5 @@ ADD minio.dockerimage /minio
ADD export /export
EXPOSE 9000
COPY start.sh /start.sh
ENV ALLOW_CONTAINER_ROOT=1
ENTRYPOINT ["/start.sh"]

View file

@ -41,6 +41,11 @@ func isContainerized() bool {
}
}
// Check if env var explicitly set
if allow := os.Getenv("ALLOW_CONTAINER_ROOT"); allow == "1" || strings.ToLower(allow) == "true" {
return true
}
/* Add checks for non-docker containers here. */
return false
}