Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit a62d4a6

Browse files
authored
Merge pull request #424 from thaJeztah/19.03_backport_39608_short_libnetwork_id
[19.03 backport] daemon: Use short libnetwork ID in exec-root & update libnetwork Upstream-commit: 9077436e6e9c4b4a7050d2412b370ff49d6e161b Component: engine
2 parents 9e38db3 + cbc9071 commit a62d4a6

7 files changed

Lines changed: 28 additions & 12 deletions

File tree

components/engine/builder/builder-next/executor_unix.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/docker/docker/daemon/config"
1212
"github.com/docker/docker/pkg/idtools"
13+
"github.com/docker/docker/pkg/stringid"
1314
"github.com/docker/libnetwork"
1415
"github.com/moby/buildkit/executor"
1516
"github.com/moby/buildkit/executor/oci"
@@ -100,11 +101,12 @@ func (iface *lnInterface) Set(s *specs.Spec) {
100101
logrus.WithError(iface.err).Error("failed to set networking spec")
101102
return
102103
}
104+
shortNetCtlrID := stringid.TruncateID(iface.provider.NetworkController.ID())
103105
// attach netns to bridge within the container namespace, using reexec in a prestart hook
104106
s.Hooks = &specs.Hooks{
105107
Prestart: []specs.Hook{{
106108
Path: filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe"),
107-
Args: []string{"libnetwork-setkey", "-exec-root=" + iface.provider.Config().Daemon.ExecRoot, iface.sbx.ContainerID(), iface.provider.NetworkController.ID()},
109+
Args: []string{"libnetwork-setkey", "-exec-root=" + iface.provider.Config().Daemon.ExecRoot, iface.sbx.ContainerID(), shortNetCtlrID},
108110
}},
109111
}
110112
}

components/engine/daemon/oci_linux.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/docker/docker/oci/caps"
2121
"github.com/docker/docker/pkg/idtools"
2222
"github.com/docker/docker/pkg/mount"
23+
"github.com/docker/docker/pkg/stringid"
2324
"github.com/docker/docker/rootless/specconv"
2425
volumemounts "github.com/docker/docker/volume/mounts"
2526
"github.com/opencontainers/runc/libcontainer/apparmor"
@@ -66,13 +67,14 @@ func WithLibnetwork(daemon *Daemon, c *container.Container) coci.SpecOpts {
6667
for _, ns := range s.Linux.Namespaces {
6768
if ns.Type == "network" && ns.Path == "" && !c.Config.NetworkDisabled {
6869
target := filepath.Join("/proc", strconv.Itoa(os.Getpid()), "exe")
70+
shortNetCtlrID := stringid.TruncateID(daemon.netController.ID())
6971
s.Hooks.Prestart = append(s.Hooks.Prestart, specs.Hook{
7072
Path: target,
7173
Args: []string{
7274
"libnetwork-setkey",
7375
"-exec-root=" + daemon.configStore.GetExecRoot(),
7476
c.ID,
75-
daemon.netController.ID(),
77+
shortNetCtlrID,
7678
},
7779
})
7880
}

components/engine/hack/dockerfile/install/proxy.installer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# LIBNETWORK_COMMIT is used to build the docker-userland-proxy binary. When
44
# updating the binary version, consider updating github.com/docker/libnetwork
55
# in vendor.conf accordingly
6-
LIBNETWORK_COMMIT=3eb39382bfa6a3c42f83674ab080ae13b0e34e5d # bump_19.03 branch
6+
LIBNETWORK_COMMIT=d9a6682a4dbb13b1f0d8216c425fe9ae010a0f23 # bump_19.03 branch
77

88
install_proxy() {
99
case "$1" in

components/engine/vendor.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ github.com/gofrs/flock 7f43ea2e6a643ad441fc12d0ecc0
3838
# libnetwork
3939

4040
# When updating, also update LIBNETWORK_COMMIT in hack/dockerfile/install/proxy.installer accordingly
41-
github.com/docker/libnetwork 3eb39382bfa6a3c42f83674ab080ae13b0e34e5d # bump_19.03 branch
41+
github.com/docker/libnetwork d9a6682a4dbb13b1f0d8216c425fe9ae010a0f23 # bump_19.03 branch
4242
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
4343
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
4444
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec

components/engine/vendor/github.com/docker/libnetwork/agent.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/overlay.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/engine/vendor/github.com/docker/libnetwork/sandbox_externalkey_unix.go

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)