diff --git a/src/addons.js b/src/addons.js index a5abfd284..e3e46a49e 100644 --- a/src/addons.js +++ b/src/addons.js @@ -992,6 +992,7 @@ function startMysql(existingInfra, callback) { if (error) return callback(error); const cmd = `docker run --restart=always -d --name="mysql" \ + --hostname mysql \ --net cloudron \ --net-alias mysql \ --log-driver syslog \ @@ -1204,6 +1205,7 @@ function startPostgresql(existingInfra, callback) { if (error) return callback(error); const cmd = `docker run --restart=always -d --name="postgresql" \ + --hostname postgresql \ --net cloudron \ --net-alias postgresql \ --log-driver syslog \ @@ -1378,6 +1380,7 @@ function startMongodb(existingInfra, callback) { if (error) return callback(error); const cmd = `docker run --restart=always -d --name="mongodb" \ + --hostname mongodb \ --net cloudron \ --net-alias mongodb \ --log-driver syslog \ @@ -1572,6 +1575,7 @@ function setupRedis(app, options, callback) { const label = app.fqdn; // note that we do not add appId label because this interferes with the stop/start app logic const cmd = `docker run --restart=always -d --name=${redisName} \ + --hostname ${redisName} \ --label=location=${label} \ --net cloudron \ --net-alias ${redisName} \ diff --git a/src/docker.js b/src/docker.js index b81593d86..a232c1d4c 100644 --- a/src/docker.js +++ b/src/docker.js @@ -235,7 +235,7 @@ function createSubcontainer(app, name, cmd, options, callback) { // Note that Hostname has no effect on DNS. We have to use the --net-alias for dns. // Hostname cannot be set with container NetworkMode var containerOptions = { - name: name, // used for filtering logs + name: name, // for referencing containers Tty: isAppContainer, Hostname: app.id, // set to something 'constant' so app containers can use this to communicate (across app updates) Image: app.manifest.dockerImage, @@ -273,7 +273,7 @@ function createSubcontainer(app, name, cmd, options, callback) { }, CpuShares: 512, // relative to 1024 for system processes VolumesFrom: isAppContainer ? null : [ app.containerId + ':rw' ], - NetworkMode: 'cloudron', + NetworkMode: 'cloudron', // user defined bridge network Dns: ['172.18.0.1'], // use internal dns DnsSearch: ['.'], // use internal dns SecurityOpt: [ 'apparmor=docker-cloudron-app' ] diff --git a/src/graphs.js b/src/graphs.js index aa6224048..7578abbff 100644 --- a/src/graphs.js +++ b/src/graphs.js @@ -19,6 +19,7 @@ function startGraphite(existingInfra, callback) { if (existingInfra.version === infra.version && infra.images.graphite.tag === existingInfra.images.graphite.tag) return callback(); const cmd = `docker run --restart=always -d --name="graphite" \ + --hostname graphite \ --net cloudron \ --net-alias graphite \ --log-driver syslog \ diff --git a/src/sftp.js b/src/sftp.js index 2913d5e29..cf53062c0 100644 --- a/src/sftp.js +++ b/src/sftp.js @@ -19,6 +19,7 @@ function startSftp(existingInfra, callback) { if (existingInfra.version === infra.version && infra.images.graphite.tag === existingInfra.images.graphite.tag) return callback(); const cmd = `docker run --restart=always -d --name="sftp" \ + --hostname sftp \ --net cloudron \ --net-alias sftp \ --log-driver syslog \