I need to keep my Windows Container up so I can run further commands on it using docker exec
.
On Linux, I'd start it to run either sleep infinity
, or tail -f /dev/null
. Alternatively, I could borrow pause.c
from Kubernetes.
What does this look like on Windows?
Use ping -t localhost
will do it
A full run command would be:
docker run -d --name YourContainer mcr.microsoft.com/windows/nanoserver:1809 ping -t localhost
Note: Make sure 1809 is equal with your own windows version from [WIN]
+[R]
-> winver
.
You should then be able to step into the running container instance with the name YourContainer
:
docker exec -it YourContainer cmd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With