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

Commit

Permalink
Merge pull request #260 from thaJeztah/19.03_backport_buildkit_system…
Browse files Browse the repository at this point in the history
…d_resolvconf

[19.03 backport] build: buildkit now also uses systemd's resolv.conf
  • Loading branch information
andrewhsu authored Jun 4, 2019
2 parents 0678d71 + feb373a commit 5fbc0a1
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 182 deletions.
24 changes: 2 additions & 22 deletions daemon/daemon_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ import (
"strings"

"github.com/docker/docker/daemon/config"
"github.com/docker/docker/internal/procfs"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/mount"
"github.com/docker/libnetwork/resolvconf"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

const (
defaultResolvConf = "/etc/resolv.conf"
alternateResolvConf = "/run/systemd/resolve/resolv.conf"
)

// On Linux, plugins use a static path for storing execution state,
// instead of deriving path from daemon's exec-root. This is because
// plugin socket files are created here and they cannot exceed max
Expand Down Expand Up @@ -148,20 +143,5 @@ func setupResolvConf(config *config.Config) {
if config.ResolvConf != "" {
return
}

config.ResolvConf = defaultResolvConf
pids, err := procfs.PidOf("systemd-resolved")
if err != nil {
logrus.Errorf("unable to check systemd-resolved status: %s", err)
return
}
if len(pids) > 0 && pids[0] > 0 {
_, err := os.Stat(alternateResolvConf)
if err == nil {
logrus.Infof("systemd-resolved is running, so using resolvconf: %s", alternateResolvConf)
config.ResolvConf = alternateResolvConf
return
}
logrus.Infof("systemd-resolved is running, but %s is not present, fallback to %s", alternateResolvConf, defaultResolvConf)
}
config.ResolvConf = resolvconf.Path()
}
105 changes: 0 additions & 105 deletions internal/procfs/procfs_linux.go

This file was deleted.

36 changes: 0 additions & 36 deletions internal/procfs/procfs_linux_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ github.com/imdario/mergo 7c29201646fa3de8506f70121347
golang.org/x/sync e225da77a7e68af35c70ccbf71af2b83e6acac3c

# buildkit
github.com/moby/buildkit 37d53758a68d9f5cede1806dbb2da7c3caa8d5bc
github.com/moby/buildkit 1f89ec125f84c097bdf3a063be622c4238dba5f8
github.com/tonistiigi/fsutil 3bbb99cdbd76619ab717299830c60f6f2a533a6b
github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746
github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7
Expand All @@ -39,7 +39,7 @@ github.com/gofrs/flock 7f43ea2e6a643ad441fc12d0ecc0
# libnetwork

# When updating, also update LIBNETWORK_COMMIT in hack/dockerfile/install/proxy.installer accordingly
github.com/docker/libnetwork 5ac07abef4eee176423fdc1b870d435258e2d381
github.com/docker/libnetwork fc5a7d91d54cc98f64fc28f9e288b46a0bee756c
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
Expand Down
20 changes: 10 additions & 10 deletions vendor/github.com/docker/libnetwork/controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 38 additions & 4 deletions vendor/github.com/docker/libnetwork/resolvconf/resolvconf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/docker/libnetwork/sandbox_dns_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/moby/buildkit/executor/oci/resolvconf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5fbc0a1

Please sign in to comment.