This is a Docker on Windows Server Core Insider 2016 Vagrant environment for playing with Windows containers.
Install the Base Windows Server Core Insider Box.
Install the required plugins:
vagrant plugin install vagrant-reload
Then launch the environment:
vagrant up --provider=virtualbox # or --provider=libvirt
At the end of the provision the examples are run.
The Docker Engine API endpoint is available at http://10.0.0.3:2375.
Portainer is available at http://10.0.0.3:9000.
Project Honolulu is available at https://10.0.0.3:8443.
Windows containers cannot be gracefully shutdown, either there is no shutdown notification or they are forcefully terminated after a while. Check the moby issue 25982 for progress.
The next table describes whether a docker stop --time 600 <container>
will graceful shutdown a container that is running a console, gui, or service app.
base image | app | behaviour |
---|---|---|
nanoserver | console | does not receive the shutdown notification |
windowsservercore | console | receives the shutdown notification but is killed after about 5 seconds |
nanoserver | gui | fails to run RegisterClass (there's no GUI support in nano) |
windowsservercore | gui | receives the shutdown notification but is killed after about 5 seconds |
nanoserver | service | only receives the pre shutdown notification but is killed after about 10 seconds |
windowsservercore | service | only receives the pre shutdown notification but is killed after about 10 seconds |
You can launch these example containers from host as:
vagrant execute -c '/vagrant/ps.ps1 examples/graceful-terminating-console-application/run.ps1'
vagrant execute -c '/vagrant/ps.ps1 examples/graceful-terminating-gui-application/run.ps1'
vagrant execute -c '/vagrant/ps.ps1 examples/graceful-terminating-windows-service/run.ps1'
- Restart the docker daemon in debug mode and watch the logs:
- set
"debug": true
inside the$env:ProgramData\docker\config\daemon.json
file - restart docker with
Restart-Service docker
- watch the logs with
Get-EventLog -LogName Application -Source docker -Newest 50
- set
- For more information see the Microsoft Troubleshooting guide and the CleanupContainerHostNetworking page.