This error occurs when you try to pull or run a Windows container image while Docker is configured to use Linux containers. Docker Desktop on Windows can run either Linux or Windows containers, but not both simultaneously. Switch Docker to Windows container mode or use a Linux-based image instead.
Docker supports two types of containers on Windows: Linux containers and Windows containers. These use fundamentally different underlying technologies and cannot be mixed. Linux containers run inside a lightweight virtual machine (using WSL 2 or Hyper-V), while Windows containers run natively on the Windows kernel. When you try to pull or run an image built for Windows (such as images based on `mcr.microsoft.com/windows/nanoserver` or `mcr.microsoft.com/windows/servercore`), but Docker is configured to run Linux containers, you get this error. Docker cannot run Windows container images on the Linux container engine. The error message "image operating system 'windows' cannot be used on this platform" indicates a mismatch between the container image's target OS and the currently active Docker daemon mode. This is not a bug - it's Docker correctly identifying that the image cannot run in the current configuration.
First, verify which container mode Docker is currently using:
Check via Docker Desktop:
1. Look at the Docker icon in the Windows system tray
2. Right-click the Docker whale icon
3. If you see "Switch to Windows containers...", you're in Linux mode
4. If you see "Switch to Linux containers...", you're in Windows mode
Check via command line:
docker versionLook at the "OS/Arch" line under "Server". If it shows linux/amd64, Docker is in Linux container mode. If it shows windows/amd64, you're in Windows container mode.
Check the image architecture:
docker manifest inspect mcr.microsoft.com/windows/nanoserver:ltsc2022This shows the image's target OS and architecture.
If you need to run Windows containers on Windows:
Using the system tray:
1. Right-click the Docker whale icon in the Windows system tray
2. Click "Switch to Windows containers..."
3. Docker Desktop will restart with Windows container support
Note: You'll see a confirmation dialog. Click "Switch" to confirm.
After switching:
- All running Linux containers will stop
- Docker daemon will restart using Windows container backend
- You can now pull and run Windows container images
Important requirements:
- Windows 10/11 Professional, Enterprise, or Education edition
- Windows Home does NOT support Windows containers
- Hyper-V and Containers Windows features must be enabled
Windows containers require specific Windows features to be enabled:
Enable via PowerShell (run as Administrator):
# Enable Containers feature
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All
# Enable Hyper-V (required for isolation)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -AllEnable via Windows Features GUI:
1. Press Win + R, type optionalfeatures, press Enter
2. Check "Containers"
3. Check "Hyper-V" and all sub-items
4. Click OK and restart when prompted
Verify features are enabled:
Get-WindowsOptionalFeature -Online -FeatureName Containers
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-VBoth should show State: Enabled.
If you're on Linux, macOS, or prefer Linux containers, use Linux-based versions of the images:
For .NET applications:
# Instead of Windows nanoserver:
# FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-ltsc2022
# Use Linux-based image:
FROM mcr.microsoft.com/dotnet/aspnet:8.0
# Or explicitly specify Linux:
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slimCommon Windows images and their Linux alternatives:
| Windows Image | Linux Alternative |
|--------------|-------------------|
| mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-ltsc2022 | mcr.microsoft.com/dotnet/aspnet:8.0 |
| mcr.microsoft.com/windows/servercore:ltsc2022 | Use appropriate Linux base (alpine, debian, ubuntu) |
| mcr.microsoft.com/mssql/server:2022-latest (Linux available) | Same image works on Linux |
Update your Dockerfile or docker-compose.yml to use the Linux-based image tags.
CI/CD environments require specific configuration for Windows containers:
Azure DevOps:
Use a Windows-based agent pool:
pool:
vmImage: 'windows-latest'
steps:
- script: |
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022
displayName: 'Pull Windows image'For Azure Container Registry builds:
# Specify Windows platform explicitly
az acr build --registry myregistry --image myimage:v1 --platform windows .GitHub Actions:
Use Windows runner:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build Windows container
run: docker build -t myapp:windows .Important: GitHub Actions and most CI platforms default to Linux runners. Windows container builds require explicit Windows runner configuration.
After switching to Windows containers, verify everything works:
Check Docker mode:
docker versionThe Server OS/Arch should now show windows/amd64.
Test pulling a Windows image:
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022Run a simple Windows container:
docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd /c "echo Hello from Windows container"If the pull still fails:
- Ensure you're on Windows Pro/Enterprise/Education (not Home)
- Verify Hyper-V and Containers features are enabled
- Restart Docker Desktop completely
- Check that the Windows version matches the image tag (e.g., ltsc2022 requires Windows Server 2022 or Windows 11)
Docker Desktop can only run one container type at a time. If you need both:
Option 1: Switch between modes as needed
- Use system tray to switch between Linux and Windows containers
- Not ideal for workflows requiring both simultaneously
Option 2: Use separate Docker hosts
- Run Linux containers on WSL 2 Docker instance
- Run Windows containers on Windows Docker daemon
- Use different Docker contexts:
# List available contexts
docker context ls
# Create Windows container context
docker context create windows-containers --docker host=npipe:////./pipe/dockerDesktopWindowsEngine
# Switch context
docker context use windows-containersOption 3: Use a multi-platform build approach
Build images for both platforms and push to registry:
docker buildx build --platform linux/amd64,windows/amd64 -t myapp:latest --push .Note: Multi-platform builds require appropriate base images for each platform.
Windows container isolation modes:
Windows containers support two isolation modes:
- Process isolation: Container shares kernel with host. Faster but requires matching Windows versions.
- Hyper-V isolation: Container runs in lightweight VM. More secure, allows version mismatch.
Use the --isolation flag:
docker run --isolation=hyperv mcr.microsoft.com/windows/nanoserver:ltsc2022 cmdWindows container version compatibility:
Windows containers have version requirements:
| Image Tag | Host Requirements |
|-----------|------------------|
| ltsc2022 | Windows Server 2022, Windows 11 |
| ltsc2019 | Windows Server 2019, Windows 10 1809+ |
| 1809 | Windows 10 1809, Server 2019 |
With Hyper-V isolation, you can run older container versions on newer hosts.
Security considerations:
Windows containers (especially in process isolation mode) run with more host access than Linux containers. The ContainerAdministrator user inside Windows containers is effectively a local administrator on the host when using process isolation.
For sensitive workloads:
- Use Hyper-V isolation for better security boundary
- Consider Linux containers where possible
- Follow principle of least privilege for container users
Docker Toolbox limitation:
Docker Toolbox (legacy) uses VirtualBox and only supports Linux containers. It cannot run Windows containers. Upgrade to Docker Desktop for Windows container support.
macOS and Linux hosts:
Windows containers cannot run on macOS or Linux hosts, even with virtualization. The Windows kernel is required. For Windows container development on non-Windows systems:
- Use a Windows VM
- Use Windows-based CI/CD runners
- Develop with Linux containers and deploy Windows containers on Windows infrastructure
image operating system "linux" cannot be used on this platform
How to fix 'image operating system linux cannot be used on this platform' in Docker
manifest unknown: manifest unknown
How to fix 'manifest unknown' in Docker
cannot open '/etc/passwd': Permission denied
How to fix 'cannot open: Permission denied' in Docker
Error response from daemon: failed to create the ipvlan port
How to fix 'failed to create the ipvlan port' in Docker
toomanyrequests: Rate exceeded for anonymous users
How to fix 'Rate exceeded for anonymous users' in Docker Hub