Skip to content

The --name flag causes an error when used with docker run #3549

Closed

Description

@jt0dd

This problem is in the context of a fresh install of Docker for Windows, a freshly downloaded mcr.microsoft.com/windows:20H2 image (I've reproduced the problem on mcr.microsoft.com/windows/nanoserver:ltsc2022 and mcr.microsoft.com/windows/servercore:ltsc2022 images), and I have restarted my (Windows 11 Pro OS) PC. And yes, Hyper-v is enabled:

Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online

FeatureName      : Microsoft-Hyper-V-All
DisplayName      : Hyper-V
Description      : Provides services and management tools for creating and running virtual machines and their resources.
RestartRequired  : Possible
State            : Enabled
CustomProperties :

I am running all commands from PowerShell, but am no longer using PS ISE. Edit: Just tested in CMD shell and same errors.

Description

the --name flag causes an error when used with docker run.

This works:
docker run -it mcr.microsoft.com/windows:20H2 --isolation=hyperv

I get a CLI for the container, everything is good.

This doesn't work:
docker run -it mcr.microsoft.com/windows:20H2 --isolation=hyperv --name=workstation_1

When I add the --name=workstation_1 argument, which according to docker run --help is a valid argument:

enter image description here

I get this error:

docker: Error response from daemon: container 1118d316b0700307943bec10392b39266b79db08350311618fb5bfc247e2fa8d encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF6EBB1A40B: (caller: 00007FF6EBAD5C8B) Exception(1) tid(398) 80070002 The system cannot find the file specified.
    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
 Provider: 00000000-0000-0000-0000-000000000000].

Steps to reproduce the issue:

  1. Launch Windows 11 Pro.
  2. Activate Docker for Windows.
  3. Run docker run -it mcr.microsoft.com/windows:20H2 --isolation=hyperv --name=workstation_1

Describe the results you received:

docker: Error response from daemon: container 1118d316b0700307943bec10392b39266b79db08350311618fb5bfc247e2fa8d encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF6EBB1A40B: (caller: 00007FF6EBAD5C8B) Exception(1) tid(398) 80070002 The system cannot find the file specified.
    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
 Provider: 00000000-0000-0000-0000-000000000000].

As an alternative, I tried:

    docker create mcr.microsoft.com/windows:20H2 --name=workstation_1

and

    docker create mcr.microsoft.com/windows:20H2 --name="workstation_1"

Since docker create --help indicates this is also a valid argument:

enter image description here

And this doesn't fail, but it also doesn't name the container.

Describe the results you expected:

A new (working) container with the name specified. A container does get made by the above code, it's just broken.

Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version:

    Client:
     Cloud integration: v1.0.22
     Version:           20.10.13
     API version:       1.41
     Go version:        go1.16.15
     Git commit:        a224086
     Built:             Thu Mar 10 14:13:04 2022
     OS/Arch:           windows/amd64
     Context:           default
     Experimental:      true
    
    Server: Docker Desktop 4.6.1 (76265)
     Engine:
      Version:          20.10.13
      API version:      1.41 (minimum version 1.24)
      Go version:       go1.16.15
      Git commit:       906f57f
      Built:            Thu Mar 10 14:08:21 2022
      OS/Arch:          windows/amd64
      Experimental:     false

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.1)
  compose: Docker Compose (Docker Inc., v2.3.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 4
 Server Version: 20.10.13
 Storage Driver: windowsfilter
  Windows: 
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 22000 (22000.1.amd64fre.co_release.210604-1628)
 Operating System: Windows 10 Pro Version 2009 (OS Build 22000.556)
 OSType: windows
 Architecture: x86_64
 CPUs: 16
 Total Memory: 31.92GiB
 Name: DESKTOP-4KS9BL7
 ID: CVZW:NI3U:JZC6:N763:N5AR:34KN:3QAO:KGIQ:SYDS:WODV:YDGK:U2X7
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Additional environment details (AWS, VirtualBox, physical, etc.):

I'm running a valid, licensed copy of Windows 11 Pro on a physical PC.

Activity

  1. ch33hau commented on Apr 10, 2022

    @ch33hau
    docker run --help
    
    Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
    

    Options should be placed before IMAGE, anything after an IMAGE are command and arguments...

    Maybe you want to try this?

    docker run -it --isolation=hyperv --name=workstation_1 mcr.microsoft.com/windows:20H2
    
  2. jt0dd commented on Apr 10, 2022

    @jt0dd
    Author

    docker run -it --isolation=hyperv --name=workstation_1 mcr.microsoft.com/windows:20H2

    You're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions