mirror of https://github.com/docker/docs.git
Fix --ipc=host dependency on /dev/mqueue existing
Since #15862, containers fail to start when started with --ipc=host if /dev/mqueue is not present. This change causes docker to create container-local mounts for --ipc=host containers as well as in the default case. Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
This commit is contained in:
parent
9ead1663c3
commit
f624d6187a
|
|
@ -288,7 +288,7 @@ func (container *Container) Start() (err error) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !container.hostConfig.IpcMode.IsContainer() && !container.hostConfig.IpcMode.IsHost() {
|
if !container.hostConfig.IpcMode.IsContainer() {
|
||||||
if err := container.setupIpcDirs(); err != nil {
|
if err := container.setupIpcDirs(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -214,12 +214,6 @@ func populateCommand(c *Container, env []string) error {
|
||||||
ipc.ContainerID = ic.ID
|
ipc.ContainerID = ic.ID
|
||||||
c.ShmPath = ic.ShmPath
|
c.ShmPath = ic.ShmPath
|
||||||
c.MqueuePath = ic.MqueuePath
|
c.MqueuePath = ic.MqueuePath
|
||||||
} else {
|
|
||||||
ipc.HostIpc = c.hostConfig.IpcMode.IsHost()
|
|
||||||
if ipc.HostIpc {
|
|
||||||
c.ShmPath = "/dev/shm"
|
|
||||||
c.MqueuePath = "/dev/mqueue"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pid := &execdriver.Pid{}
|
pid := &execdriver.Pid{}
|
||||||
|
|
@ -1408,7 +1402,7 @@ func (container *Container) setupIpcDirs() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (container *Container) unmountIpcMounts() error {
|
func (container *Container) unmountIpcMounts() error {
|
||||||
if container.hostConfig.IpcMode.IsContainer() || container.hostConfig.IpcMode.IsHost() {
|
if container.hostConfig.IpcMode.IsContainer() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue