seccomp_disabled.go 793 B

1234567891011121314151617181920212223242526
  1. //go:build linux && !seccomp
  2. // +build linux,!seccomp
  3. package daemon // import "github.com/docker/docker/daemon"
  4. import (
  5. "context"
  6. "fmt"
  7. "github.com/containerd/containerd/containers"
  8. coci "github.com/containerd/containerd/oci"
  9. "github.com/docker/docker/container"
  10. dconfig "github.com/docker/docker/daemon/config"
  11. )
  12. const supportsSeccomp = false
  13. // WithSeccomp sets the seccomp profile
  14. func WithSeccomp(daemon *Daemon, c *container.Container) coci.SpecOpts {
  15. return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
  16. if c.SeccompProfile != "" && c.SeccompProfile != dconfig.SeccompProfileUnconfined {
  17. return fmt.Errorf("seccomp profiles are not supported on this daemon, you cannot specify a custom seccomp profile")
  18. }
  19. return nil
  20. }
  21. }