mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
add environment var to explicitly indicate containerized and allow running as root (#1327)
This commit is contained in:
committed by
Harshavardhana
parent
b47d722d8e
commit
af907a35a9
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user