瀏覽代碼

Merge pull request #43813 from thaJeztah/22.06_backport_fix_43781

[22.06 backport] libnetwork: skip firewalld management for rootless
Sebastiaan van Stijn 3 年之前
父節點
當前提交
c4c8a80958
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      libnetwork/iptables/iptables.go

+ 7 - 0
libnetwork/iptables/iptables.go

@@ -14,6 +14,7 @@ import (
 	"sync"
 	"time"
 
+	"github.com/docker/docker/rootless"
 	"github.com/sirupsen/logrus"
 )
 
@@ -105,6 +106,12 @@ func probe() {
 }
 
 func initFirewalld() {
+	// When running with RootlessKit, firewalld is running as the root outside our network namespace
+	// https://github.com/moby/moby/issues/43781
+	if rootless.RunningWithRootlessKit() {
+		logrus.Info("skipping firewalld management for rootless mode")
+		return
+	}
 	if err := FirewalldInit(); err != nil {
 		logrus.Debugf("Fail to initialize firewalld: %v, using raw iptables instead", err)
 	}