Windows 2016: Docker container error Windows 2016: Docker container error docker docker

Windows 2016: Docker container error


Because Windows containers are sharing same kernel with host machine you cannot have spooler running on both same time. So stop and disable spooler from host and you are able use spooler on one container on that server.

Here is fixed set of commands:

Stop-Service spoolerSet-Service spooler -StartupType Disableddocker run -d --name testspoolererror1 microsoft/windowsservercore:latest ping -t localhostdocker exec -it testspoolererror1 powershellInstall-WindowsFeature Print-ServerSet-Service spooler -StartupType AutomaticStart-Service spoolerGet-Service spoolerGet-Printer


I'm sorry to hear you're having this issue and I'll be glad to do what I can to help you sort it out :)

For the sake of being thorough, I tried this myself by running the following commands:

docker run -it microsoft/windowsservercore:latest powershell

(Now running powershell from within container)

Install-WindowsFeature Print-ServerSet-Service spooler -StartupType AutomaticStart-Service spoolerGet-Service spoolerGet-Printer

I was able to run these on my system, without an error. So that's a start.

Now, from your error it looks like the spooler service didn't even start. What do you see when you run Get-Service spooler? Will you try running these commands on your system just as I have listed them above then report back with your results?

Also, to clarify, what are you trying to do when you're pinging localhost from the container? Are you trying to ping your container host?

And as a side note, if you're looking for background info on how container networking works on Windows, here's a good place to start: https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-networking

--Kallie B. (Program Manager, Microsoft Networking Team)


The reason that Kallie seems to have been able to get the above steps to work is probably because it is being hosted differently. I tried the above steps via Docker on a Server 2016 box, and hit the same errors. When I tried it via Docker on Windows 10, I was able to launch the spooler successfully and run the above commands, but I couldn't install any drivers successfully which would make it actually useful. Pnputil just throws odd "No Data" errors when attempting to install any .inf's.

My guess is that it works on Windows 10 because it's using hyper-v emulation instead of the native container used when hosting Server 2016 Core on Server 2016. Another thing I noticed was that the drivers are inherited from the base machine when creating a container on Server 2016, but not on Windows 10. I assume that's fairly well-understood behavior by Docker experts, but it does seem like the inherited drivers might be causing the crash. I'm not a Windows expert either, though.

Either way, it seems like something that Microsoft will have to look into and resolve.