mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +00:00
Docker 1.11.1
This commit is contained in:
@@ -1,30 +1,21 @@
|
||||
package systemdocker
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/docker"
|
||||
"github.com/rancher/os/config"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
var newEnv []string
|
||||
for _, env := range os.Environ() {
|
||||
if !strings.HasPrefix(env, "DOCKER_HOST=") {
|
||||
newEnv = append(newEnv, env)
|
||||
}
|
||||
}
|
||||
|
||||
newEnv = append(newEnv, "DOCKER_HOST="+config.DOCKER_SYSTEM_HOST)
|
||||
|
||||
if os.Geteuid() != 0 {
|
||||
log.Fatalf("%s: Need to be root", os.Args[0])
|
||||
}
|
||||
|
||||
os.Args[0] = config.DOCKER_DIST_BIN
|
||||
if err := syscall.Exec(os.Args[0], os.Args, newEnv); err != nil {
|
||||
log.Fatal(err)
|
||||
if os.Getenv("DOCKER_HOST") == "" {
|
||||
os.Setenv("DOCKER_HOST", config.DOCKER_SYSTEM_HOST)
|
||||
}
|
||||
|
||||
docker.Main()
|
||||
}
|
||||
|
Reference in New Issue
Block a user