-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker run mcr.microsoft.com/windows/servercore:ltsc2022 -i --isolation=hyperv resulting in errors #3548
Comments
I just noticed that if I run the image directly from the Docker for Windows CLI, it works. I get a shell, no problems. So why could the CLI be broken? |
I figured out the issue. All of this testing has been from a PowerShell ISE terminal. And that's creating the issue somehow. From any other terminal, it actually works. Edit: No it doesn't. It just doesn't give that error. But it produces a broken container. GUI still works. CLI doesn't, no matter what terminal I run it from. I just get:
If I try to run the resulting container from the Docker GUI: It does the same thing, instantly dies. Edit 2: Figured out what's going on here. One decidedly ignored bug (PowerShell ISE fails with error handling that doesn't shed any light on the actual problem, that's one issue) and a documentation inconsistency. That's what all this comes down to. If I run the command documented here (with -it) it runs fine. I was running the command
I would argue this documentation is just plain wrong, or at the very least misleading. So first I was running it from the wrong place, and then I was running the wrong command, which the Docker page for that image says to use. |
|
Ok, the plot thickens. I don't mean to complicate things, but each time I think it's working, I find a different thing causing a problem. This works: This doesn't: When I add the --name workstation_1 argument, which according to I get this error:
|
Looks like the same cause as your other ticket #3549 As to documentation; documentation of images on docker hub is maintained by the respective image publishers (in this case Microsoft); if there's issues with that documentation, it's best to report it via the link mentioned under the "support" section on that page. |
I see. I thought since Microsoft had integrated Docker a bit they were working together on that resource. But you're correct. All of this was a rather confusing error message due to an out-of-order argument. In most CLIs can't the argument orders (especially named arguments), be used more freely? Would it be so hard for Docker CLI to just do better parsing of the the arguments passed to it? It isn't exactly difficult to parse --flag=value from a string after all. |
The POSIX guidelines generally recommends flags (options) to appear before positional arguments (operands). While tools often are somewhat more flexible, for example, while on docker inspect --format="{{.ID}}" busybox:latest
docker inspect busybox:latest --format="{{.ID}}" This can only work for some commands though, and was not intentional (but has worked in the past, so we kept the "feature" to not unnecessarily break users), but we don't document (nor officially support) this.
... for example, on For example, on a Linux container with $ docker run --rm --entrypoint=/bin/busybox busybox:latest --help
BusyBox v1.34.1 (2022-03-10 23:58:34 UTC) multi-call binary.
...
... Putting the $ docker run --rm --entrypoint=/bin/busybox --help busybox:latest
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container
...
Don't under-estimate the complexity involved in parsing command-line options 😅; command-line parsing can be very complicated; there's many corner-cases (see https://twitter.com/thaJeztah/status/1260921988102656002?s=20 and urfave/cli#1092 for some fun), and depending on the platform or executable in use, sometimes literally impossible (see opencontainers/runtime-spec#998 for some discussion on that (and, yes, that pull request came from Microsoft, and no, they were not able to fix it in Windows itself)). |
Thanks for the explanations, clearly this is a subject I was (am) incredibly naive on. |
Description
According to Docker's documentation, using
--isolation=hyperv
should make most versions of windows images compatible:So it seems like compatibility shouldn't be an issue with hyper-v.
Well, when I run:
Describe the results you received:
I get the error (see the bottom of the thread, I'm aware the top is just a matter of the image being pulled):
This is after I've tried many different images, with and without hyper-v, restarted my PC, and reset Docker to factory default settings.
Removing
--isolation=hyperv
results in precisely the same error. I've also tried--isolation=process
and gotten the same error.Describe the results you expected:
A Windows shell
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
I'm running a valid, licensed copy of Windows 11 Pro on a physical PC.
The text was updated successfully, but these errors were encountered: