mirror of
https://github.com/xiaoqidun/goenv.git
synced 2024-11-25 17:36:45 +08:00
feat(主机名称): goenv命令添加-h参数映射主机名称
This commit is contained in:
parent
65cfce1285
commit
b9976086a1
3
goenv.go
3
goenv.go
@ -57,6 +57,9 @@ func (d *DockerGoEnv) Run() {
|
||||
d.CmdArgs = append(d.CmdArgs, "-v", pwd+":"+d.WorkDir, "-w", d.WorkDir)
|
||||
}
|
||||
}
|
||||
if hostname, err1 := os.Hostname(); err1 == nil {
|
||||
d.CmdArgs = append(d.CmdArgs, "-h", hostname)
|
||||
}
|
||||
d.CmdArgs = append(d.CmdArgs, d.Image)
|
||||
cmd := exec.Command(d.Binary, d.CmdArgs...)
|
||||
cmd.Stdin = os.Stdin
|
||||
|
Loading…
x
Reference in New Issue
Block a user