Failed to pull image "namarog/imagename": rpc error: code = Unknown desc = image operating system " windows" cannot be used on this platform

My issue is as following. I have my setup for linux but every single image I create and try to deploy becomes a windows image. I do not want it to be a windows image but it just keeps creating.

I have followed the exact same steps on my other computer and there it works fine. Using the same yaml file and the same DockerFile.

How can I solve this?

Here under is my DockerFIle

# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "ProjectName.dll"]
apiVersion: apps/v1
kind: Deployment
metadata:
  name: platforms-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ProjectName
  template:
    metadata:
      labels:
        app: ProjectName
    spec:
      containers:
        - name: ProjectName
          image: namarog/ProjectName

and here is my yaml file.

This is all a setup on a fresh computer. This here is driving my crazy because I keep getting the Error: ImagePullBackOff

I dont understand what I am doing wrong.

Please, format your post next time using the </> button above the message text area when you insert codes or terminal outputs, log messages. Otherwise people who don’t have right to edit a post will not understand your code because of the incorrect indentation and the lack of highlighting or completely removed parts because of the MarkDown filter. I fixed your post and the spam filter hid it for some reason until a moderator unhid it.

Since you didn’t share the actual imagename, I can’t tell you if the image has the right architecture, but this is what I found: https://hub.docker.com/r/namarog/platformservice/tags

If this is the image you tried, it is a Windows container image and that will not work on Linux.
I see different commands in the history of the image, but I don’t know if /app is converted to C:\app in the final image when you build it in Windows containers mode and I think the bse images has windows compatible versions as well.

If this is not the image you are trying to use, I still think the reason can be the same or similar. Without knowing more about the image, I don’t have a better idea. If an image has a version for Windows and also Linux, Docker pulls the version that is compatible with the Docker host.