Skip to content

Commit c7123af

Browse files
authored
Fix Docker instruction when host IP has more than 1 digit (#1594)
Instead of replacing the last char with `1`: replace everything starting from the last dot with `.1`. For instance, my Docker assigned the IP `172.30.0.14` to the interface which resulted to the wrong gateway IP `172.30.0.11`
1 parent 58a705d commit c7123af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ option.
141141
import os # only if you haven't already imported this
142142
import socket # only if you haven't already imported this
143143
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
144-
INTERNAL_IPS = [ip[:-1] + '1' for ip in ips] + ['127.0.0.1', '10.0.2.2']
144+
INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + ["127.0.0.1", "10.0.2.2"]
145145

146146
Troubleshooting
147147
---------------

0 commit comments

Comments
 (0)