Skip to content

Unable to run mcr.microsoft.com/windows/nanoserver:ltsc2025 based containers with custom users #640

Description

@qasim-sajid-snkeos

Describe the bug
Unable to run mcr.microsoft.com/windows/nanoserver:ltsc2025 based containers with custom users.

To Reproduce
Steps to reproduce the behavior:

  1. Create the following dockerfile:
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025

USER ContainerAdministrator

RUN net accounts /MaxPWAge:unlimited && \
    net user /add "MyCustomUser" /expires:never && \
    net localgroup "Network Configuration Operators" "MyCustomUser" /add

USER MyCustomUser

ENTRYPOINT ["CMD"]
  1. Build an image using the above dockerfile:
    docker build -f Dockerfile -t my-test-image .

  2. Run the container:
    docker run my-test-image

  3. Output:

$ docker run my-test-image
b8a23122bd391ac7db803793a98b55752372d44e06af5b8a5ddf1fa74f614b62
docker: Error response from daemon: container b8a23122bd391ac7db803793a98b55752372d44e06af5b8a5ddf1fa74f614b62 encountered an error during hcs::System::CreateProcess: CMD: failure in a Windows system call: The specified domain either does not exist or could not be contacted. (0x54b)

Run 'docker run --help' for more information

Expected behavior
The container should run successfully like it does for mcr.microsoft.com/windows/servercore:ltsc2022.

Configuration:

  • Edition: Windows Server 2025
  • Base Image being used: mcr.microsoft.com/windows/nanoserver:ltsc2025
  • Container engine: Docker
  • Container Engine version:
PS C:\Users\Administrator> docker version
Client:
 Version:           29.1.5
 API version:       1.52
 Go version:        go1.25.6
 Git commit:        0e6fee6
 Built:             Fri Jan 16 12:51:08 2026
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          29.1.5
  API version:      1.52 (minimum version 1.44)
  Go version:       go1.25.6
  Git commit:       3b01d641
  Built:            Fri Jan 16 12:48:28 2026
  OS/Arch:          windows/amd64
  Experimental:     false

Additional context
The same dockerfile but with the default ContainerUser works fine. Also, the exact same dockerfile but with the mcr.microsoft.com/windows/nanoserver:ltsc2022 image works fine as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew and needs attention

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions