github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/pkg/parsers/operatingsystem/operatingsystem_unix.go (about) 1 // +build freebsd darwin 2 3 package operatingsystem 4 5 import ( 6 "errors" 7 "os/exec" 8 ) 9 10 // GetOperatingSystem gets the name of the current operating system. 11 func GetOperatingSystem() (string, error) { 12 cmd := exec.Command("uname", "-s") 13 osName, err := cmd.Output() 14 if err != nil { 15 return "", err 16 } 17 return string(osName), nil 18 } 19 20 // IsContainerized returns true if we are running inside a container. 21 // No-op on FreeBSD and Darwin, always returns false. 22 func IsContainerized() (bool, error) { 23 // TODO: Implement jail detection for freeBSD 24 return false, errors.New("Cannot detect if we are in container") 25 }