mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Adjusts Docker capabilities per OS, and checks for runtime on Windows. --------- Co-authored-by: Tim Gross <tgross@hashicorp.com>
20 lines
554 B
Go
20 lines
554 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
//go:build !windows
|
|
|
|
package capabilities
|
|
|
|
import docker "github.com/fsouza/go-dockerclient"
|
|
|
|
// DockerDefaults is a list of Linux capabilities enabled by Docker by default
|
|
// and is used to compute the set of capabilities to add/drop given docker driver
|
|
// configuration.
|
|
//
|
|
// https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
|
|
func DockerDefaults(info *docker.Env) *Set {
|
|
defaults := NomadDefaults()
|
|
defaults.Add("NET_RAW")
|
|
return defaults
|
|
}
|