mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Modprobe bridge driver r specific kernel modules
Try too modprobe bridge driverer specic modulein case they are not loaded into the kernel. Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
parent
db5f2f40fb
commit
61993ec6c2
1 changed files with 8 additions and 0 deletions
|
@ -3,10 +3,12 @@ package bridge
|
|||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/libnetwork/driverapi"
|
||||
"github.com/docker/libnetwork/ipallocator"
|
||||
"github.com/docker/libnetwork/netlabel"
|
||||
|
@ -104,6 +106,12 @@ func newDriver() driverapi.Driver {
|
|||
|
||||
// Init registers a new instance of bridge driver
|
||||
func Init(dc driverapi.DriverCallback) error {
|
||||
// try to modprobe bridge first
|
||||
// see gh#12177
|
||||
if out, err := exec.Command("modprobe", "-va", "bridge", "nf_nat", "br_netfilter").Output(); err != nil {
|
||||
logrus.Warnf("Running modprobe bridge nf_nat failed with message: %s, error: %v", out, err)
|
||||
}
|
||||
|
||||
return dc.RegisterDriver(networkType, newDriver())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue