diff --git a/daemon/info.go b/daemon/info.go index 00d659a0ff..ada3aa4508 100644 --- a/daemon/info.go +++ b/daemon/info.go @@ -71,7 +71,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) { if sysInfo.AppArmor { securityOptions = append(securityOptions, "apparmor") } - if sysInfo.Seccomp { + if sysInfo.Seccomp && supportsSeccomp { securityOptions = append(securityOptions, "seccomp") } if selinuxEnabled() { diff --git a/daemon/seccomp_disabled.go b/daemon/seccomp_disabled.go index 8f13f5606d..4ad1b7c53f 100644 --- a/daemon/seccomp_disabled.go +++ b/daemon/seccomp_disabled.go @@ -1,4 +1,4 @@ -// +build !seccomp,!windows +// +build linux,!seccomp package daemon @@ -9,6 +9,8 @@ import ( "github.com/opencontainers/specs/specs-go" ) +var supportsSeccomp = false + 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") diff --git a/daemon/seccomp_linux.go b/daemon/seccomp_linux.go index 34ffcb5975..e9622787ee 100644 --- a/daemon/seccomp_linux.go +++ b/daemon/seccomp_linux.go @@ -11,6 +11,8 @@ import ( "github.com/opencontainers/specs/specs-go" ) +var supportsSeccomp = true + func setSeccomp(daemon *Daemon, rs *specs.Spec, c *container.Container) error { var profile *specs.Seccomp var err error diff --git a/daemon/seccomp_unsupported.go b/daemon/seccomp_unsupported.go new file mode 100644 index 0000000000..b3691e96af --- /dev/null +++ b/daemon/seccomp_unsupported.go @@ -0,0 +1,5 @@ +// +build !linux + +package daemon + +var supportsSeccomp = false