Unable to find user ContainerUser: invalid argument

Hi,
what is this error?
#12 ERROR: process “cmd /S /C dotnet restore "webappjishnui/webappjishnui.csproj"” did not complete successfully: unable to find user ContainerUser: invalid argument

[build 4/7] RUN dotnet restore “webappjishnui/webappjishnui.csproj”:


Dockerfile:11

9 | WORKDIR /src
10 | COPY [“webappjishnui/webappjishnui.csproj”, “webappjishnui/”]
11 | >>> RUN dotnet restore “webappjishnui/webappjishnui.csproj”
12 | COPY . .
13 | WORKDIR “/src/webappjishnui”

ERROR: failed to solve: process “cmd /S /C dotnet restore "webappjishnui/webappjishnui.csproj"” did not complete successfully: unable to find user ContainerUser: invalid argument
Process exited with code 1

Have you had any luck with this? We are running into a similar problem

The OP did hide the relevant details that would help to understand the situation. I guess it is the reason it never received any response, other than yours.

Please create your own topic, describe your current situation and share the original Dockerfile you experience the problem with, so we get a chance to actually see what you do. Leave everything as is, and only redact credentials / secrets (both should actually not exist in a Dockerfile), private ips or private domains.

I had the same issue until I removed the nanoserver part of the FROM statement
Try:

FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809 AS build   => FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

answer from “docker - 'Unable to Find User ContainerUser' when building Windows Dockerfile via Actions Runner - Stack Overflow

Hello, if your Env is Windows , I also have this problem and troubled me 1 weeks
Finally , I found the problem is your docker setting need some configuration in Windows.

  1. Please make sure windows open ‘open Hyper-V’ feature
  2. In powershell enter this :Enable-WindowsOptionalFeature -Online -FeatureName $(“Microsoft-Hyper-V”,“Containers”) -All

Enable-WindowsOptionalFeature -Online -FeatureName $(“Microsoft-Hyper-V”,“Containers”) -All

I found that the most important thing is , if you are Windows OS,
you need to change the docker-desktop to ‘windows contain’ mode!!!