@@ -23,7 +23,6 @@ import (
2323 "github.com/docker/docker/oci/caps"
2424 "github.com/docker/docker/pkg/idtools"
2525 "github.com/docker/docker/pkg/rootless/specconv"
26- "github.com/docker/docker/pkg/stringid"
2726 volumemounts "github.com/docker/docker/volume/mounts"
2827 "github.com/moby/sys/mount"
2928 "github.com/moby/sys/mountinfo"
@@ -61,28 +60,6 @@ func withRlimits(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Contain
6160 }
6261}
6362
64- // withLibnetwork sets the libnetwork hook
65- func withLibnetwork (daemon * Daemon , daemonCfg * dconfig.Config , c * container.Container ) coci.SpecOpts {
66- return func (ctx context.Context , _ coci.Client , _ * containers.Container , s * coci.Spec ) error {
67- if c .Config .NetworkDisabled {
68- return nil
69- }
70- for _ , ns := range s .Linux .Namespaces {
71- if ns .Type == specs .NetworkNamespace && ns .Path == "" {
72- if s .Hooks == nil {
73- s .Hooks = & specs.Hooks {}
74- }
75- shortNetCtlrID := stringid .TruncateID (daemon .netController .ID ())
76- s .Hooks .Prestart = append (s .Hooks .Prestart , specs.Hook {
77- Path : filepath .Join ("/proc" , strconv .Itoa (os .Getpid ()), "exe" ),
78- Args : []string {"libnetwork-setkey" , "-exec-root=" + daemonCfg .GetExecRoot (), c .ID , shortNetCtlrID },
79- })
80- }
81- }
82- return nil
83- }
84- }
85-
8663// withRootless sets the spec to the rootless configuration
8764func withRootless (daemon * Daemon , daemonCfg * dconfig.Config ) coci.SpecOpts {
8865 return func (_ context.Context , _ coci.Client , _ * containers.Container , s * coci.Spec ) error {
@@ -1070,7 +1047,6 @@ func (daemon *Daemon) createSpec(ctx context.Context, daemonCfg *configStore, c
10701047 WithCapabilities (c ),
10711048 WithSeccomp (daemon , c ),
10721049 withMounts (daemon , daemonCfg , c , mounts ),
1073- withLibnetwork (daemon , & daemonCfg .Config , c ),
10741050 WithApparmor (c ),
10751051 WithSelinux (c ),
10761052 WithOOMScore (& c .HostConfig .OomScoreAdj ),
0 commit comments