blob: 03bf4c82fa42c8c1d37114193bde1815277840d5 [file] [log] [blame]
package client
import "regexp"
var headerRegexp = regexp.MustCompile(`\ADocker/.+\s\((.+)\)\z`)
// getDockerOS returns the operating system based on the server header from the daemon.
func getDockerOS(serverHeader string) string {
var osType string
matches := headerRegexp.FindStringSubmatch(serverHeader)
if len(matches) > 0 {
osType = matches[1]
}
return osType
}