5,323
edits
Line 184: | Line 184: | ||
* You do not need to add <code>expose</code>. | * You do not need to add <code>expose</code>. | ||
By default, netoworks are allocated with ip ranges: | |||
* 172.17.0.0/12 with size /16 | |||
* 192.168.0.0/16 with size /20 | |||
If you want this to be more consistent, you can change it as follows: | |||
Set the following in <code>/etc/docker/daemon.json</code>: | Set the following in <code>/etc/docker/daemon.json</code>: | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
Line 193: | Line 197: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Then restart your docker: <code>sudo systemctl restart docker</code> and prune networks <code>docker network prune</code>.<br> | Then restart your docker: <code>sudo systemctl restart docker</code> and prune networks <code>docker network prune</code>.<br> | ||
Next, in your firewall, allow connections to your localhost from 172.16.0.0/12. | Next, in your firewall, allow connections to your localhost from 172.16.0.0/12. | ||
<pre> | <pre> |