mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
6bd797b43f
Fixes #23031 If a profile is explicitly passed but the system is not built with seccomp support, error out rather than just running without a profile at all as we would previously. Behaviour is unchanged if no profile is specified or unconfined is specified. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
17 lines
427 B
Go
17 lines
427 B
Go
// +build !seccomp,!windows
|
|
|
|
package daemon
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/docker/docker/container"
|
|
"github.com/opencontainers/specs/specs-go"
|
|
)
|
|
|
|
func setSeccomp(daemon *Daemon, rs *specs.Spec, c *container.Container) error {
|
|
if c.SeccompProfile != "" && c.SeccompProfile != "unconfined" {
|
|
return fmt.Errorf("seccomp profiles are not supported on this daemon, you cannot specify a custom seccomp profile")
|
|
}
|
|
return nil
|
|
}
|