From 58308facf0dd9c86cbba7fc4c2c684a025ddeb0e Mon Sep 17 00:00:00 2001 From: Blue Date: Tue, 5 May 2026 11:30:59 -0700 Subject: [PATCH] Don't fail if inspect output has null Devices (#40405) --- src/windows/inc/docker_schema.h | 2 +- src/windows/wslcsession/WSLCContainer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/windows/inc/docker_schema.h b/src/windows/inc/docker_schema.h index 45de5539f..2b1d418b4 100644 --- a/src/windows/inc/docker_schema.h +++ b/src/windows/inc/docker_schema.h @@ -214,7 +214,7 @@ struct HostConfig std::optional> DnsOptions; std::optional> Binds; std::map Tmpfs; - std::vector Devices; + std::optional> Devices; NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(HostConfig, Mounts, PortBindings, NetworkMode, Init, Dns, DnsSearch, DnsOptions, Binds, Tmpfs, Devices); }; diff --git a/src/windows/wslcsession/WSLCContainer.cpp b/src/windows/wslcsession/WSLCContainer.cpp index 4aeeae7cf..b4cbb98cc 100644 --- a/src/windows/wslcsession/WSLCContainer.cpp +++ b/src/windows/wslcsession/WSLCContainer.cpp @@ -1394,7 +1394,7 @@ std::unique_ptr WSLCContainerImpl::Create( request.HostConfig.Binds->push_back(std::format("{0}:{0}:ro", WSLCVirtualMachine::c_gpuLibrariesPath)); request.HostConfig.Binds->push_back(std::format("{0}:{0}:ro", WSLCVirtualMachine::c_gpuDriversPath)); - request.HostConfig.Devices.push_back({"/dev/dxg", "/dev/dxg", "rwm"}); + request.HostConfig.Devices = {{"/dev/dxg", "/dev/dxg", "rwm"}}; ConfigureLdPathForGpu(request.Env); }