mirror of
https://github.com/rancher/os.git
synced 2025-09-01 06:40:31 +00:00
Update godeps
This commit is contained in:
25
cmd/systemdocker/system-docker.go
Normal file
25
cmd/systemdocker/system-docker.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
func SystemDocker() {
|
||||
var newEnv []string
|
||||
for _, env := range os.Environ() {
|
||||
if !strings.HasPrefix(env, "DOCKER_HOST=") {
|
||||
newEnv = append(newEnv, env)
|
||||
}
|
||||
}
|
||||
|
||||
newEnv = append(newEnv, "DOCKER_HOST=unix:///var/run/system-docker.sock")
|
||||
|
||||
os.Args[0] = "/usr/bin/docker"
|
||||
if err := syscall.Exec(os.Args[0], os.Args, newEnv); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user