Skip to content

Docker 'Platform' returns an object instead of a string in Docker Desktop v4.42.0 #1504

@WardenGnaw

Description

@WardenGnaw

With Docker Desktop v4.42.0, Platform is not a string, it is now an object that looks like:

"Platform": {
   "os": "linux",
   "architecture": "amd64"
}

This is due to the deserialiation of the property defined at

public string Platform { get; set; }

Expected:
Extracts the platform os.

Actual:

Failed to parse json '{"Command":"\"dotnet --roll-forward Major /VSTools/DistrolessHelper/DistrolessHelper.dll --wait\"","CreatedAt":"2025-06-19 12:08:02 -0500 CDT","ID":"e81b3b26902a90d6294aab1819e045d8b9b692f81f0dc6351652d191c071e921","Image":"webapplication44:dev","Names":"WebApplication44","Networks":"bridge","Platform":{"architecture":"amd64","os":"linux"},"Ports":"0.0.0.0:32768-\u003e8080/tcp, 0.0.0.0:32769-\u003e8081/tcp","RunningFor":"2 hours ago","Size":"102kB (virtual 230MB)","State":"running","Status":"Up 2 hours"}'.\r\nError: 'Newtonsoft.Json.JsonReaderException: Error reading string. Unexpected token: StartObject. Path 'Platform', line 1, position 3649.
   at Newtonsoft.Json.JsonReader.ReadAsString()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject[T]()
   at Microsoft.SSHDebugPS.Docker.DockerContainerInstance.TryCreate(String json, DockerContainerInstance& instance)'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions