Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!