mirror of
https://github.com/jeessy2/ddns-go.git
synced 2025-10-20 23:43:45 +08:00
13 lines
244 B
Go
13 lines
244 B
Go
package util
|
|
|
|
import "os"
|
|
|
|
// DockerEnvFile Docker容器中包含的文件
|
|
const DockerEnvFile string = "/.dockerenv"
|
|
|
|
// IsRunInDocker 是否在docker中运行
|
|
func IsRunInDocker() bool {
|
|
_, err := os.Stat(DockerEnvFile)
|
|
return err == nil
|
|
}
|