Added to advertise-addr docker swarm join command - Fixes https://github.com/caprover/caprover/issues/572

This commit is contained in:
Kasra Bigdeli
2020-07-04 16:41:36 -04:00
parent 4dfb4c0ea5
commit 593925453c
2 changed files with 8 additions and 3 deletions

View File

@@ -163,8 +163,12 @@ class DockerApi {
}) })
} }
createJoinCommand(captainIpAddress: string, token: string) { createJoinCommand(
return `docker swarm join --token ${token} ${captainIpAddress}:2377` captainIpAddress: string,
token: string,
workerIp: string
) {
return `docker swarm join --token ${token} ${captainIpAddress}:2377 --advertise-addr ${workerIp}:2377`
} }
getNodesInfo() { getNodesInfo() {

View File

@@ -40,7 +40,8 @@ export default class DockerUtils {
CaptainConstants.disableFirewallCommand CaptainConstants.disableFirewallCommand
} ${dockerApi.createJoinCommand( } ${dockerApi.createJoinCommand(
captainIpAddress, captainIpAddress,
token token,
remoteNodeIpAddress
)}`, )}`,
function (err, stream) { function (err, stream) {
if (err) { if (err) {