GetDockerPlatform gets the platform used for Docker engine
()
| 59 | |
| 60 | // GetDockerPlatform gets the platform used for Docker engine |
| 61 | func 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 |
| 99 | func GetLiveMutagenVersion() (string, error) { |
no test coverage detected