1
0
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:
Darren Shepherd
2016-05-31 21:38:10 -07:00
parent 43f90b8e61
commit 8ab32c820f
16 changed files with 75 additions and 78 deletions

View File

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