MCPcopy Create free account
hub / github.com/ddev/ddev / GetDockerPlatform

Function GetDockerPlatform

pkg/version/version.go:61–96  ·  view source on GitHub ↗

GetDockerPlatform gets the platform used for Docker engine

()

Source from the content-addressed store, hash-verified

59
60// GetDockerPlatform gets the platform used for Docker engine
61func GetDockerPlatform() (string, error) {
62 info, err := dockerutil.GetDockerClientInfo()
63 if err != nil {
64 return "", err
65 }
66
67 platform := info.OperatingSystem
68 switch {
69 case dockerutil.IsDockerDesktop():
70 platform = "docker-desktop"
71 case dockerutil.IsRancherDesktop():
72 platform = "rancher-desktop"
73 case dockerutil.IsColima():
74 platform = "colima"
75 case dockerutil.IsLima():
76 platform = "lima"
77 case dockerutil.IsOrbStack():
78 platform = "orbstack"
79 case dockerutil.IsPodman():
80 platform = "podman"
81 case nodeps.IsWSL2() && info.OSType == "linux":
82 platform = "wsl2-docker-ce"
83 case !nodeps.IsWSL2() && info.OSType == "linux":
84 platform = "linux-docker"
85 }
86
87 if dockerutil.IsRootless() {
88 platform += "-rootless"
89 }
90
91 if dockerutil.IsSELinux() {
92 platform += "-selinux"
93 }
94
95 return platform, nil
96}
97
98// GetLiveMutagenVersion runs `mutagen version` and caches result
99func GetLiveMutagenVersion() (string, error) {

Callers 3

identifyFunction · 0.92
renderAppDescribeFunction · 0.92
GetVersionInfoFunction · 0.85

Calls 10

GetDockerClientInfoFunction · 0.92
IsDockerDesktopFunction · 0.92
IsRancherDesktopFunction · 0.92
IsColimaFunction · 0.92
IsLimaFunction · 0.92
IsOrbStackFunction · 0.92
IsPodmanFunction · 0.92
IsWSL2Function · 0.92
IsRootlessFunction · 0.92
IsSELinuxFunction · 0.92

Tested by

no test coverage detected