Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #54 from rancher-sandbox/fixes-localhost-restart
Browse files Browse the repository at this point in the history
Run the iptable rule for localhost during container initialization
  • Loading branch information
Nino-K authored Oct 27, 2023
2 parents cefd79e + ba09878 commit dacc4e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/docker/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ func (e *EventMonitor) initializeRunningContainers(ctx context.Context) error {
if err := e.portTracker.Add(container.ID, portMap); err != nil {
log.Errorf("registering already running containers failed: %v", err)
}

for _, netSettings := range container.NetworkSettings.Networks {
err = createLoopbackIPtablesRules(
netSettings.IPAddress,
portMap)

if err != nil {
log.Errorf("failed running iptable rules to update DNAT rule in DOCKER chain: %v", err)
}
}
}
}

Expand Down

0 comments on commit dacc4e1

Please sign in to comment.