statically allocate app container IPs

We removed httpPort with the assumption that docker allocated IPs
and kept them as long as the container is around. This turned out
to be not true because the IP changes on even container restart.

So we now allocate IPs statically. The iprange makes sure we don't
overlap with addons and other CI app or JupyterHub apps.

https://github.com/moby/moby/issues/6743
https://github.com/moby/moby/pull/19001
This commit is contained in:
Girish Ramakrishnan
2020-11-20 14:13:16 -08:00
parent 64af278f39
commit c0b0029935
13 changed files with 165 additions and 59 deletions

View File

@@ -343,6 +343,9 @@ function createSubcontainer(app, name, cmd, options, callback) {
containerOptions.NetworkingConfig = {
EndpointsConfig: {
cloudron: {
IPAMConfig: {
IPv4Address: app.containerIp
},
Aliases: [ name ] // adds hostname entry with container name
}
}