Unverified Commit 756e733d authored by Danielle Tomlinson's avatar Danielle Tomlinson Committed by GitHub
Browse files

Merge pull request #5327 from hashicorp/dani/windows-term

drivers/docker: SIGTERM to stop containers
parents 941f89e0 e2244cd0
Showing with 8 additions and 0 deletions
+8 -0
......@@ -1022,6 +1022,14 @@ func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) e
signal = "SIGINT"
}
// Windows Docker daemon does not support SIGINT, SIGTERM is the semantic equivalent that
// allows for graceful shutdown before being followed up by a SIGKILL.
// Supported signals:
// https://github.com/moby/moby/blob/0111ee70874a4947d93f64b672f66a2a35071ee2/pkg/signal/signal_windows.go#L17-L26
if runtime.GOOS == "windows" && signal == "SIGINT" {
signal = "SIGTERM"
}
sig, err := signals.Parse(signal)
if err != nil {
return fmt.Errorf("failed to parse signal: %v", err)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment