Browse Source

Ensure vmcompute.dll exists during daemon start

Signed-off-by: Darren Stahl <darst@microsoft.com>
Darren Stahl 8 năm trước cách đây
mục cha
commit
000366f1a7
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      daemon/daemon_windows.go

+ 6 - 0
daemon/daemon_windows.go

@@ -24,6 +24,7 @@ import (
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/options"
 	"github.com/docker/libnetwork/options"
 	blkiodev "github.com/opencontainers/runc/libcontainer/configs"
 	blkiodev "github.com/opencontainers/runc/libcontainer/configs"
+	"golang.org/x/sys/windows"
 )
 )
 
 
 const (
 const (
@@ -230,6 +231,11 @@ func checkSystem() error {
 	if osv.Build < 14393 {
 	if osv.Build < 14393 {
 		return fmt.Errorf("The docker daemon requires build 14393 or later of Windows Server 2016 or Windows 10")
 		return fmt.Errorf("The docker daemon requires build 14393 or later of Windows Server 2016 or Windows 10")
 	}
 	}
+
+	vmcompute := windows.NewLazySystemDLL("vmcompute.dll")
+	if vmcompute.Load() != nil {
+		return fmt.Errorf("Failed to load vmcompute.dll. Ensure that the Containers role is installed.")
+	}
 	return nil
 	return nil
 }
 }