mirror of
https://github.com/clearlinux/docker.git
synced 2026-08-19 12:16:30 +00:00
check if the daemon is run as root on startup
This commit makes Docker throw an error if the daemon isn't started as root. Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
This commit is contained in:
@@ -97,6 +97,10 @@ func main() {
|
||||
}
|
||||
|
||||
if *flDaemon {
|
||||
if os.Geteuid() != 0 {
|
||||
log.Fatalf("The Docker daemon needs to be run as root")
|
||||
}
|
||||
|
||||
if flag.NArg() != 0 {
|
||||
flag.Usage()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user