瀏覽代碼

Merge pull request #16992 from burke/fix-mqueue

Fix --ipc=host dependency on /dev/mqueue existing
David Calavera 9 年之前
父節點
當前提交
678acbcb3f
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      daemon/container_unix.go

+ 6 - 0
daemon/container_unix.go

@@ -218,6 +218,12 @@ func populateCommand(c *Container, env []string) error {
 	} else {
 		ipc.HostIpc = c.hostConfig.IpcMode.IsHost()
 		if ipc.HostIpc {
+			if _, err := os.Stat("/dev/shm"); err != nil {
+				return fmt.Errorf("/dev/shm is not mounted, but must be for --host=ipc")
+			}
+			if _, err := os.Stat("/dev/mqueue"); err != nil {
+				return fmt.Errorf("/dev/mqueue is not mounted, but must be for --host=ipc")
+			}
 			c.ShmPath = "/dev/shm"
 			c.MqueuePath = "/dev/mqueue"
 		}