mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
fix: allow direct routing from WireGuard mesh to containers for Docker 28.2.0+
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/psviderski/uncloud/internal/machine/dns"
|
"github.com/psviderski/uncloud/internal/machine/dns"
|
||||||
"github.com/psviderski/uncloud/internal/machine/firewall"
|
"github.com/psviderski/uncloud/internal/machine/firewall"
|
||||||
"github.com/psviderski/uncloud/internal/machine/network"
|
"github.com/psviderski/uncloud/internal/machine/network"
|
||||||
|
"github.com/psviderski/uncloud/pkg/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EnsureUncloudNetwork creates the Docker bridge network NetworkName with the provided machine subnet
|
// EnsureUncloudNetwork creates the Docker bridge network NetworkName with the provided machine subnet
|
||||||
@@ -52,6 +53,14 @@ func (m *Manager) EnsureUncloudNetwork(ctx context.Context, subnet netip.Prefix,
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Labels: map[string]string{
|
||||||
|
api.LabelManaged: "",
|
||||||
|
},
|
||||||
|
Options: map[string]string{
|
||||||
|
// Starting with Docker 28.2.0 (https://github.com/moby/moby/pull/49832), we have to explicitly
|
||||||
|
// allow direct routing from the WireGuard interface to the bridge network.
|
||||||
|
"com.docker.network.bridge.trusted_host_interfaces": network.WireGuardInterfaceName,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return fmt.Errorf("create Docker network '%s': %w", NetworkName, err)
|
return fmt.Errorf("create Docker network '%s': %w", NetworkName, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user