*: purge dockerinit from source code
dockerinit has been around for a very long time. It was originally used as a way for us to do configuration for LXC containers once the container had started. LXC is no longer supported, and /.dockerinit has been dead code for quite a while. This removes all code and references in code to dockerinit. Signed-off-by: Aleksa Sarai <asarai@suse.com> Upstream-commit: 4357ed4a7363a1032edf93cf03232953c805184f Component: engine
This commit is contained in:
@@ -254,7 +254,6 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
|
||||
c.Command = &execdriver.Command{
|
||||
CommonCommand: execdriver.CommonCommand{
|
||||
ID: c.ID,
|
||||
InitPath: "/.dockerinit",
|
||||
MountLabel: c.GetMountLabel(),
|
||||
Network: en,
|
||||
ProcessConfig: processConfig,
|
||||
|
||||
@@ -124,7 +124,6 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
|
||||
CommonCommand: execdriver.CommonCommand{
|
||||
ID: c.ID,
|
||||
Rootfs: c.BaseFS,
|
||||
InitPath: "/.dockerinit",
|
||||
WorkingDir: c.Config.WorkingDir,
|
||||
Network: en,
|
||||
MountLabel: c.GetMountLabel(),
|
||||
|
||||
@@ -688,8 +688,7 @@ func initBridgeDriver(controller libnetwork.NetworkController, config *Config) e
|
||||
}
|
||||
|
||||
// setupInitLayer populates a directory with mountpoints suitable
|
||||
// for bind-mounting dockerinit into the container. The mountpoint is simply an
|
||||
// empty file at /.dockerinit
|
||||
// for bind-mounting things into the container.
|
||||
//
|
||||
// This extra layer is used by all containers as the top-most ro layer. It protects
|
||||
// the container from unwanted side-effects on the rw layer.
|
||||
@@ -699,7 +698,6 @@ func setupInitLayer(initLayer string, rootUID, rootGID int) error {
|
||||
"/dev/shm": "dir",
|
||||
"/proc": "dir",
|
||||
"/sys": "dir",
|
||||
"/.dockerinit": "file",
|
||||
"/.dockerenv": "file",
|
||||
"/etc/resolv.conf": "file",
|
||||
"/etc/hosts": "file",
|
||||
|
||||
@@ -131,7 +131,6 @@ type CommonProcessConfig struct {
|
||||
type CommonCommand struct {
|
||||
ContainerPid int `json:"container_pid"` // the pid for the process inside a container
|
||||
ID string `json:"id"`
|
||||
InitPath string `json:"initpath"` // dockerinit
|
||||
MountLabel string `json:"mount_label"` // TODO Windows. More involved, but can be factored out
|
||||
Mounts []Mount `json:"mounts"`
|
||||
Network *Network `json:"network"`
|
||||
|
||||
@@ -49,11 +49,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
||||
logrus.Errorf("Could not read system memory info: %v", err)
|
||||
}
|
||||
|
||||
// if we still have the original dockerinit binary from before
|
||||
// we copied it locally, let's return the path to that, since
|
||||
// that's more intuitive (the copied path is trivial to derive
|
||||
// by hand given VERSION)
|
||||
initPath := utils.DockerInitPath("")
|
||||
sysInfo := sysinfo.New(true)
|
||||
|
||||
var cRunning, cPaused, cStopped int32
|
||||
@@ -94,8 +89,6 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
||||
OSType: platform.OSType,
|
||||
Architecture: platform.Architecture,
|
||||
RegistryConfig: daemon.RegistryService.Config,
|
||||
InitSha1: dockerversion.InitSHA1,
|
||||
InitPath: initPath,
|
||||
NCPU: runtime.NumCPU(),
|
||||
MemTotal: meminfo.MemTotal,
|
||||
DockerRootDir: daemon.configStore.Root,
|
||||
|
||||
Reference in New Issue
Block a user