diff --git a/setup/start.sh b/setup/start.sh index 3f535d782..1253796bb 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -32,6 +32,8 @@ systemctl enable apparmor systemctl restart apparmor usermod ${USER} -a -G docker +# unbound (which starts after box code) relies on this interface to exist. dockerproxy also relies on this. +docker network create --subnet=172.18.0.0/16 --ip-range=172.18.0.0/20 cloudron || true mkdir -p "${BOX_DATA_DIR}" mkdir -p "${APPS_DATA_DIR}" diff --git a/setup/start/systemd/unbound.service b/setup/start/systemd/unbound.service index 85038d6b5..ab5bde245 100644 --- a/setup/start/systemd/unbound.service +++ b/setup/start/systemd/unbound.service @@ -2,7 +2,7 @@ [Unit] Description=Unbound DNS Resolver -After=network.target docker.service +After=network.target docker.service box.service [Service] PIDFile=/run/unbound.pid diff --git a/src/platform.js b/src/platform.js index e4eab8a82..13e725b65 100644 --- a/src/platform.js +++ b/src/platform.js @@ -55,7 +55,6 @@ function start(callback) { async.series([ (next) => { if (existingInfra.version !== infra.version) removeAllContainers(next); else next(); }, - createDockerNetwork, markApps.bind(null, existingInfra), // mark app state before we start addons. this gives the db import logic a chance to mark an app as errored graphs.startGraphite.bind(null, existingInfra), sftp.startSftp.bind(null, existingInfra), @@ -132,16 +131,6 @@ function removeAllContainers(callback) { ], callback); } -function createDockerNetwork(callback) { - debug('createDockerNetwork: creating cloudron network'); - - // this gives docker the network range 172.18.0.0-172.18.15.255 - async.series([ - shell.exec.bind(null, 'createDockerNetwork', 'docker network rm cloudron || true'), // may not exist on first run - shell.exec.bind(null, 'createDockerNetwork', 'docker network create --subnet=172.18.0.0/16 --ip-range=172.18.0.0/20 cloudron || true') // can fail if (user) containers are still attached - ], callback); -} - function markApps(existingInfra, callback) { if (existingInfra.version === 'none') { // cloudron is being restored from backup debug('markApps: restoring installed apps');