No solutions for "The Docker server host is configured for "Linux"; however, the project is intended for "Windows"" problem in Windows 11

91 Views Asked by At

I'm attempting to containerize an ASP .NET application using Windows 11 Enterprise edition, but I'm encountering difficulties.

The application comprises a simple proxy application with a Dockerfile:

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2022
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker} .

and a docker-compose.yml file:

version: '3.4'

services:
  wke.documentconverter.webservice:
    image: ${DOCKER_REGISTRY-}wkedocumentconverterwebservice
    build:
      context: .\WebService
      dockerfile: Dockerfile

I'm using Visual Studio 2022, and when attempting to run the application using the "Container(Dockerfile)" option, I encounter the following output:

"The Docker server host is configured for "Linux"; however, the project is intended for "Windows"."

Switching to Windows Containers seemed like a straightforward solution, but it didn't resolve the issue. Instead, it resulted in an infinite loop, rendering Docker Desktop unusable until reinstallation.

After that I tried to build the application in the command line to see if at least I get more information about the problem. When I execute docker-compose build in my application folder I get the following error:

failed to solve: failed to register layer: link /Files/Program Files/Common Files/System/ado/en-US/msader15.dll.mui /Files/Program Files (x86)/Common Files/System/ado/en-US/msader15.dll.mui: no such file or directory

Both files exist on my machine. I tried to google that error but found nothing, except for this. Same error but for the InkObj.dll.mui (and other route, but similar). But if you scroll down you'll see the guy resolved the problem by switching to Windows Containers (which didn't work for me).

Tried to search for a solution but I found nothing...

MORE INFO

In Docker Desktop, within Settings -> Builders I have both desktop-linux and desktop-windows (and the deafult). Desktop-linux works fine but in Desktop-windows I get the following error:

Builder error request returned Internal Server Error for API route and version http://%2F%2F.%2Fpipe%2FdockerDesktopWindowsEngine/_ping, check if the server supports the requested API version

I also saw this post and in Container.targets I checked the variable $(DockerTargetOs) (because $(DockerDefaultTargetOS)' didn't exist) and It already pointed to Linux...

If you've got any advise I'm all hears

EDIT

Whenever I try to reboot Docker Desktop after attempting to switch to Windows Containers I get the following error on my screen:

enter image description here

And after trying to execute .\DockerCli.exe -SwitchDaemon I get this:

switching to windows engine: request failed and retry attempts exhausted: Post "http://ipc/engine/switch": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified.

Tried to google the error and the only interesting thing I found was this solution for a similar problem and I don't even get the output error shown in the question. Anyway, C:\ProgramData\Docker\panic.log doesn't exist in my machine...

0

There are 0 best solutions below