mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Move SysInit to a submodule
This allows docker-init to not import the main docker module, which means it won't e.g. pick up any sqlite dependencies.
This commit is contained in:
parent
d063c8d941
commit
db99966724
4 changed files with 21 additions and 3 deletions
16
docker-init/docker-init.go
Normal file
16
docker-init/docker-init.go
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/dotcloud/docker/sysinit"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
GITCOMMIT string
|
||||||
|
VERSION string
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// Running in init mode
|
||||||
|
sysinit.SysInit()
|
||||||
|
return
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/dotcloud/docker"
|
"github.com/dotcloud/docker"
|
||||||
|
"github.com/dotcloud/docker/sysinit"
|
||||||
"github.com/dotcloud/docker/utils"
|
"github.com/dotcloud/docker/utils"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
@ -23,7 +24,7 @@ var (
|
||||||
func main() {
|
func main() {
|
||||||
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
|
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
|
||||||
// Running in init mode
|
// Running in init mode
|
||||||
docker.SysInit()
|
sysinit.SysInit()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// FIXME: Switch d and D ? (to be more sshd like)
|
// FIXME: Switch d and D ? (to be more sshd like)
|
||||||
|
|
|
@ -3,6 +3,7 @@ package docker
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/dotcloud/docker/sysinit"
|
||||||
"github.com/dotcloud/docker/utils"
|
"github.com/dotcloud/docker/utils"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
@ -77,7 +78,7 @@ func init() {
|
||||||
|
|
||||||
// Hack to run sys init during unit testing
|
// Hack to run sys init during unit testing
|
||||||
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
|
if selfPath := utils.SelfPath(); selfPath == "/sbin/init" || selfPath == "/.dockerinit" {
|
||||||
SysInit()
|
sysinit.SysInit()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package docker
|
package sysinit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
Loading…
Add table
Add a link
Reference in a new issue