Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
Docker swarm join error

I am writing a bash script to automatically provision an environment, but at the stage of adding workers to the manager node it results in an error.

#!/bin/bash

WORKERSARRAY=(worker1)

banner() {
 figlet SysMonAutogen
}

create_docker_machine() {
 docker-machine create \
  -d amazonec2 \
  --amazonec2-region eu-west-1 \
  $1
}
create_infrastructure_manager() {
  echo Generating System Infrastructure...
  echo creating manager node...
  create_docker_machine manager
  echo created manager node...
}
create_infrastructure_worker() {
  for i in "${WORKERSARRAY[@]}"
  do
    echo creating $i node...
    create_docker_machine $i
   echo created $i node...
  done
 echo Nodes created...
}



machine_do() {
 docker-machine ssh $@
}

add_workers() {
  for i in "${WORKERSARRAY[@]}"
  do
   echo adding $i node as worker...
   machine_do $i docker swarm join --token $WORKER_TOKEN \
   $manager_ip:2377
   echo added $i node as worker...
  done
 echo workers added..

 }
 main() {
   banner
   create_infrastructure_manager
   create_infrastructure_worker
   manager_ip=$(machine_do manager ifconfig eth0 | grep "inet " | awk F'[: ]+' '{print $4}')
   machine_do manager sudo docker swarm init --advertise-addr      $manager_ip
   WORKER_TOKEN=$(sudo docker swarm join-token -q worker)
   add_workers
   echo infrastructure setup has finished...
   }

   main $@

Running the script produces the following error when it gets to the stage of adding workers:

remote CA does not match fingerprint

Oddly, if i manually ssh into the machine and type the swarm join command , the node is added.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda