https://github.com/rgl/docker-windows-core-insider-2016-vagrant
a Docker on Windows Server Core Insider 2016 Vagrant environment for playing with Windows containers
https://github.com/rgl/docker-windows-core-insider-2016-vagrant
docker windows
Last synced: 9 months ago
JSON representation
a Docker on Windows Server Core Insider 2016 Vagrant environment for playing with Windows containers
- Host: GitHub
- URL: https://github.com/rgl/docker-windows-core-insider-2016-vagrant
- Owner: rgl
- Created: 2017-08-07T19:43:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-24T18:22:23.000Z (over 7 years ago)
- Last Synced: 2025-05-08T06:08:29.007Z (about 1 year ago)
- Topics: docker, windows
- Language: PowerShell
- Size: 108 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a Docker on Windows Server Core Insider 2016 Vagrant environment for playing with Windows containers.
# Usage
Install the [Base Windows Server Core Insider Box](https://github.com/rgl/windows-2016-vagrant).
Install the required plugins:
```bash
vagrant plugin install vagrant-reload
```
Then launch the environment:
```bash
vagrant up --provider=virtualbox # or --provider=libvirt
```
At the end of the provision the [examples](examples/) are run.
The Docker Engine API endpoint is available at http://10.0.0.3:2375.
[Portainer](https://portainer.io/) is available at http://10.0.0.3:9000.
[Project Honolulu](https://docs.microsoft.com/en-us/windows-server/manage/honolulu/honolulu) is available at https://10.0.0.3:8443.
# Graceful Container Shutdown
**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](https://github.com/moby/moby/issues/25982) for progress.
The next table describes whether a `docker stop --time 600 ` will graceful shutdown a container that is running a [console](https://github.com/rgl/graceful-terminating-console-application-windows/), [gui](https://github.com/rgl/graceful-terminating-gui-application-windows/), or [service](https://github.com/rgl/graceful-terminating-windows-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:
```bash
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'
```
# Troubleshoot
* 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`
* For more information see the [Microsoft Troubleshooting guide](https://docs.microsoft.com/en-us/virtualization/windowscontainers/troubleshooting) and the [CleanupContainerHostNetworking](https://github.com/Microsoft/Virtualization-Documentation/tree/live/windows-server-container-tools/CleanupContainerHostNetworking) page.
# References
* [Using Insider Container Images](https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/using-insider-container-images)
* [Beyond \ - the path to Windows and Linux parity in Docker (DockerCon 17)](https://www.youtube.com/watch?v=4ZY_4OeyJsw)
* [The Internals Behind Bringing Docker & Containers to Windows (DockerCon 16)](https://www.youtube.com/watch?v=85nCF5S8Qok)
* [Introducing the Host Compute Service](https://blogs.technet.microsoft.com/virtualization/2017/01/27/introducing-the-host-compute-service-hcs/)