mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat(self-check): add Docker socket existence check
This commit is contained in:
parent
3944be2369
commit
7dfb6e86e6
8 changed files with 48 additions and 2 deletions
|
@ -9,3 +9,14 @@ import (
|
|||
func InNginxUIOfficialDocker() bool {
|
||||
return cast.ToBool(os.Getenv("NGINX_UI_OFFICIAL_DOCKER"))
|
||||
}
|
||||
|
||||
func DockerSocketExists() bool {
|
||||
if !InNginxUIOfficialDocker() {
|
||||
return false
|
||||
}
|
||||
_, err := os.Stat("/var/run/docker.sock")
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue