Skip to content

Instantly share code, notes, and snippets.

@cypx
cypx / docker.sh
Created March 1, 2018 15:25
Docker command wrapper to add ability to use "docker service exec <SERVICE_NAME> <CMD>" for executing a task on a Docker service
#!/bin/bash
# add ability to use "docker service exec <SERVICE_NAME> <CMD>" for executing a task on a Docker service
# to use this script you need to expose Docker API over TCP on all nodes of you swarm cluster
declare -A NODE_IPS
# here list all nodes of you cluster
NODE_IPS[<NODE01_NAME>]="<NODE01_IP>"
NODE_IPS[<NODE02_NAME>]="<NODE02_IP>"
NODE_IPS[<NODE03_NAME>]="<NODE03_IP>"