feat(容器支持): 在linux环境下优先使用podman
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
xiaoqidun 2021-09-08 10:56:46 +08:00
parent 2389ae64d7
commit 292daa8a0c

View File

@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/exec"
"runtime"
)
var (
@ -21,14 +22,21 @@ func main() {
Author()
return
}
d := &DockerGoEnv{
binary := "docker"
if runtime.GOOS == "linux" {
podman, err := exec.LookPath("podman")
if err == nil {
binary = podman
}
}
docker := &DockerGoEnv{
Image: "xiaoqidun/goenv",
Binary: "docker",
Binary: binary,
WorkDir: "/go/src/app",
AutoDelete: true,
MountWorkDir: true,
}
d.Run()
docker.Run()
}
func Author() {