mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05: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:
parent
0c5375146a
commit
4fac4d2149
1 changed files with 4 additions and 0 deletions
|
@ -97,6 +97,10 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if *flDaemon {
|
if *flDaemon {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
log.Fatalf("The Docker daemon needs to be run as root")
|
||||||
|
}
|
||||||
|
|
||||||
if flag.NArg() != 0 {
|
if flag.NArg() != 0 {
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue