Don't fail if inspect output has null Devices (#40405)
Blue committed
May 5, 2026 at 11:30 UTC
58308facf0dd9c86cbba7fc4c2c684a025ddeb0e
2 files changed
+2
-2
src/windows/inc/docker_schema.h
+1
-1
@@ -214,7 +214,7 @@ struct HostConfig
214
std::optional<std::vector<std::string>> DnsOptions;
215
std::optional<std::vector<std::string>> Binds;
216
std::map<std::string, std::string> Tmpfs;
217
- std::vector<DeviceMapping> Devices;
217
+ std::optional<std::vector<DeviceMapping>> Devices;
218
219
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(HostConfig, Mounts, PortBindings, NetworkMode, Init, Dns, DnsSearch, DnsOptions, Binds, Tmpfs, Devices);
220
};
src/windows/wslcsession/WSLCContainer.cpp
+1
-1
@@ -1394,7 +1394,7 @@ std::unique_ptr<WSLCContainerImpl> WSLCContainerImpl::Create(
1394
request.HostConfig.Binds->push_back(std::format("{0}:{0}:ro", WSLCVirtualMachine::c_gpuLibrariesPath));
1395
request.HostConfig.Binds->push_back(std::format("{0}:{0}:ro", WSLCVirtualMachine::c_gpuDriversPath));
1396
1397
- request.HostConfig.Devices.push_back({"/dev/dxg", "/dev/dxg", "rwm"});
1397
+ request.HostConfig.Devices = {{"/dev/dxg", "/dev/dxg", "rwm"}};
1398
1399
ConfigureLdPathForGpu(request.Env);
1400
}