Add support for DCOS host detection, improve Docker detection. (#4525)

isDocker was currently reading from `/proc/cgroup` file. But
this file alone is rather not conclusive evidence. Docker
internally has `.dockerenv` as a special file which we should
use instead.

Fixes #4456
This commit is contained in:
Harshavardhana
2017-06-12 17:33:21 -07:00
committed by Dee Koder
parent 6f4862659f
commit b8463a738c
3 changed files with 122 additions and 53 deletions

View File

@@ -138,11 +138,11 @@ func newApp(name string) *cli.App {
// Main main for minio server.
func Main(args []string) {
name := filepath.Base(args[0])
app := newApp(name)
// Set the minio app name.
appName := filepath.Base(args[0])
// Run the app - exit on error.
if err := app.Run(args); err != nil {
if err := newApp(appName).Run(args); err != nil {
os.Exit(1)
}
}