|
@@ -54,11 +54,12 @@ func init() {
|
|
|
|
|
|
type driver struct {
|
|
|
root string // root path for the driver to use
|
|
|
+ initPath string
|
|
|
apparmor bool
|
|
|
sharedRoot bool
|
|
|
}
|
|
|
|
|
|
-func NewDriver(root string, apparmor bool) (*driver, error) {
|
|
|
+func NewDriver(root, initPath string, apparmor bool) (*driver, error) {
|
|
|
// setup unconfined symlink
|
|
|
if err := linkLxcStart(root); err != nil {
|
|
|
return nil, err
|
|
@@ -66,6 +67,7 @@ func NewDriver(root string, apparmor bool) (*driver, error) {
|
|
|
return &driver{
|
|
|
apparmor: apparmor,
|
|
|
root: root,
|
|
|
+ initPath: initPath,
|
|
|
sharedRoot: rootIsShared(),
|
|
|
}, nil
|
|
|
}
|
|
@@ -79,6 +81,7 @@ func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallba
|
|
|
if err := execdriver.SetTerminal(c, pipes); err != nil {
|
|
|
return -1, err
|
|
|
}
|
|
|
+ c.Mounts = append(c.Mounts, execdriver.Mount{d.initPath, c.InitPath, false, true})
|
|
|
if err := d.generateEnvConfig(c); err != nil {
|
|
|
return -1, err
|
|
|
}
|