File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ import (
4848 "github.com/docker/go-connections/nat"
4949 "github.com/sirupsen/logrus"
5050 cdi "tags.cncf.io/container-device-interface/pkg/parser"
51+ "github.com/vishvananda/netlink"
52+
53+ "github.com/docker/compose/v2/pkg/api"
54+ "github.com/docker/compose/v2/pkg/progress"
55+ "github.com/docker/compose/v2/pkg/utils"
5156)
5257
5358type createOptions struct {
@@ -1318,6 +1323,19 @@ func (s *composeService) resolveOrCreateNetwork(ctx context.Context, n *types.Ne
13181323 }
13191324 createOpts .IPAM .Config = append (createOpts .IPAM .Config , config )
13201325 }
1326+
1327+ // override MTU value and set custom MTU one.
1328+ // This is required for gitpod.io due to the veth change
1329+ // https://github.com/gitpod-io/gitpod/pull/8955
1330+ if createOpts .Options == nil {
1331+ createOpts .Options = make (map [string ]string )
1332+ }
1333+
1334+ netIface , err := netlink .LinkByName ("ceth0" )
1335+ if err == nil {
1336+ createOpts .Options ["com.docker.network.driver.mtu" ] = fmt .Sprintf ("%v" , netIface .Attrs ().MTU )
1337+ }
1338+
13211339 networkEventName := fmt .Sprintf ("Network %s" , n .Name )
13221340 w := progress .ContextWriter (ctx )
13231341 w .Event (progress .CreatingEvent (networkEventName ))
You can’t perform that action at this time.
0 commit comments