My OS is Windows 10 and I am running Docker version 17.06.0-ce-win19. I am trying to set up a container so that it will restart automatically on reboot.
When I use the command: docker run -it microsoft/nanoserver --restart=always
I’m getting the following error:
docker: Error response from daemon: container 35046c88d2564523464ecabc4d48eb0550115e33acb25b0555224e7c43d21e74 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {“ApplicationName”:"",“CommandLine”:"–restart=always",“User”:"",“WorkingDirectory”:“C:”,“Environment”:{},“EmulateConsole”:true,“CreateStdInPipe”:true,“CreateStdOutPipe”:true,“CreateStdErrPipe”:false,“ConsoleSize”:[30,120]}.
whereas if I leave out the --restart=always
everything works fine.
Is there something else I need to do to get --restart options working on Windows?
I am using this successfully on Windows 10 v17.03.1-ce-win12, I have 2 containers in my docker instance and they both restart after a machine reboot.
What I haven’t been able to solve is the order in which they start after the reboot, I need my SQL container to initialise before my web server initialises. That is a task for another day though.