mirror of
https://github.com/xiaoqidun/goenv.git
synced 2024-11-22 16:16:46 +08:00
feat(容器支持): 在linux环境下优先使用podman
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2389ae64d7
commit
292daa8a0c
14
goenv.go
14
goenv.go
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user