Jump to content

Docker (software): Difference between revisions

Line 151: Line 151:
Previously, the Compose file (<code>docker-compose.yml</code>) required a version. Version 2 and version 3 had different options and not all options from version 2 were available in version 3. However, as of docker-compose v1.27+, you should no longer specify a version and options from both versions are supported.
Previously, the Compose file (<code>docker-compose.yml</code>) required a version. Version 2 and version 3 had different options and not all options from version 2 were available in version 3. However, as of docker-compose v1.27+, you should no longer specify a version and options from both versions are supported.


===Accessing Host===
==Accessing the Host==
See [https://github.com/qoomon/docker-host docker-host] for a container which can access the host.   
See [https://github.com/qoomon/docker-host docker-host] for a container which can access the host.   
Add the following to your docker compose to expose port 8201 to other containers:
Add the following to your docker compose to expose port 8201 to other containers:
Line 163: Line 163:


* You do not need to add <code>expose</code>.
* You do not need to add <code>expose</code>.
Set the following in <code>/etc/docker/daemon.json</code>:
<syntaxhighlight>
{
  "default-address-pools":
  [
    {"base":"172.17.0.0/12","size":24}
  ]
}
</syntaxhighlight>
This will force docker to assign subnets from 172.17.0.0/24 to 172.32.255.0/24 instead of 172.17.0.0/12 to 172.32.0.0/12.<br>
Thus it won't overflow to 192.168.0.0/24.<br>
Next, in your firewall, allow connections to your localhost from 172.17.0.0/12.


==Resources==
==Resources==