How to fix "The container operating system does not match the host operating system" error

Juned Mulla 0 Reputation points
2024-01-18T07:07:44.9366667+00:00

I have been trying to run my data-layer unit test case through pipeline. For database I am using cosmosdb. For runing these test we need cosmosdb emulator which have configured in build pipeline.

- task: azure-cosmosdb.emulator-public-preview.run-cosmosdbemulatorcontainer.CosmosDbEmulator@2
  displayName: 'Run Azure Cosmos DB Emulator container'
  enabled: true

Here it creates image of container which get created successfully while running pipeline but soon after this it throws error-->

Status: Downloaded newer image for mcr.microsoft.com/cosmosdb/windows/azure-cosmos-emulator:latest
 container 65d00cecdf71adbb12accb38f89a9980681ab32b215a1b67e4973d01fc4e912b created from image mcr.microsoft.com/cosmosdb/windows/azure-cosmos-emulator:latest
docker start 65d00cecdf71adbb12accb38f89a9980681ab32b215a1b67e4973d01fc4e912b
Error response from daemon: hcs::CreateComputeSystem 65d00cecdf71adbb12accb38f89a9980681ab32b215a1b67e4973d01fc4e912b: The container operating system does not match the host operating system.
Error: failed to start containers: 65d00cecdf71adbb12accb38f89a9980681ab32b215a1b67e4973d01fc4e912b
Task failed: container 65d00cecdf71adbb12accb38f89a9980681ab32b215a1b67e4973d01fc4e912b failed to start

My host machine is running on Windows and for docker, I do not have dockerfile in my project also docker task in my build pipeline since it all has configured in above task itself. I checked docker version and it is 24.0.7.

How should I resolve this issue?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
41,885 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.