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

master
matt robinson 9 years ago committed by Harshavardhana
parent b47d722d8e
commit af907a35a9
  1. 1
      docker/Dockerfile
  2. 5
      runtime-checks.go

@ -5,4 +5,5 @@ ADD minio.dockerimage /minio
ADD export /export ADD export /export
EXPOSE 9000 EXPOSE 9000
COPY start.sh /start.sh COPY start.sh /start.sh
ENV ALLOW_CONTAINER_ROOT=1
ENTRYPOINT ["/start.sh"] 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. */ /* Add checks for non-docker containers here. */
return false return false
} }

Loading…
Cancel
Save