mirror of
https://github.com/docker/cli.git
synced 2026-09-25 07:50:37 -05:00
Merge pull request #19245 from jfrazelle/seccomp-kernel-check
check seccomp is configured in the kernel Upstream-commit: 293b3767c8453ee7ccabe53c357965241d7afbf6 Component: engine
This commit is contained in:
@@ -238,6 +238,14 @@ func (daemon *Daemon) populateCommand(c *container.Container, env []string) erro
|
||||
}
|
||||
uidMap, gidMap := daemon.GetUIDGIDMaps()
|
||||
|
||||
if !daemon.seccompEnabled {
|
||||
if c.SeccompProfile != "" && c.SeccompProfile != "unconfined" {
|
||||
return fmt.Errorf("Seccomp is not enabled in your kernel, cannot run a custom seccomp profile.")
|
||||
}
|
||||
logrus.Warn("Seccomp is not enabled in your kernel, running container without default profile.")
|
||||
c.SeccompProfile = "unconfined"
|
||||
}
|
||||
|
||||
defaultCgroupParent := "/docker"
|
||||
if daemon.configStore.CgroupParent != "" {
|
||||
defaultCgroupParent = daemon.configStore.CgroupParent
|
||||
|
||||
@@ -157,6 +157,7 @@ type Daemon struct {
|
||||
volumes *store.VolumeStore
|
||||
discoveryWatcher discovery.Watcher
|
||||
root string
|
||||
seccompEnabled bool
|
||||
shutdown bool
|
||||
uidMaps []idtools.IDMap
|
||||
gidMaps []idtools.IDMap
|
||||
@@ -821,6 +822,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||
d.root = config.Root
|
||||
d.uidMaps = uidMaps
|
||||
d.gidMaps = gidMaps
|
||||
d.seccompEnabled = sysInfo.Seccomp
|
||||
|
||||
d.nameIndex = registrar.NewRegistrar()
|
||||
d.linkIndex = newLinkIndex()
|
||||
|
||||
Reference in New Issue
Block a user