1
0
mirror of https://github.com/rancher/os.git synced 2025-08-28 19:21:42 +00:00
os/user/system-docker.go
2015-02-14 09:37:03 -07:00

26 lines
452 B
Go

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)
}
}