-
Notifications
You must be signed in to change notification settings - Fork 0
Swarm Setup
Anandkumar Patel edited this page Apr 28, 2016
·
10 revisions
Herein lies the incantations, most arcane, that are required to setup and use swarm on your local computing machina.
- Install docker-toolbox
- Clone devops-scripts GitHub repository (note the full installation path for step 4)
- Copy
devops-scripts/ansible/roles/docker_client/ca.pem
intodevops-scripts/ansible/roles/docker_client/files/certs/swarm-manager
- Add the following to your
~/.bash_profile
:
# You may already have this, if you have installed and setup docks-cli:
export DEVOPS_SCRIPTS_PATH=<path_to_devops_scripts>
# Required to setup the SSH tunnel to swarm
export DOCKER_HOST=tcp://localhost:2375
export DOCKER_CERT_PATH="${DEVOPS_SCRIPTS_PATH}/ansible/roles/docker_client/files/certs/swarm-manager"
export DOCKER_TLS_VERIFY=1
# Used to create blocking tunnel to swarm host
# usage: setupSwarm <services_host>
alias setupSwarm='ssh -NL 2375:localhost:2375'
# Sugar functions you will normally use
alias setupSwarmGamma='setupSwarm gamma-dock-services'
alias setupSwarmDelta='setupSwarm delta-swarm-manager'
Note: you will need to replace <path_to_devops_scripts>
with the full path you noted in step 2.
Note: if you want, you can run the tunnels in the background:
alias setupSwarm='ssh -NL 2375:localhost:2375 -fq'
alias clearSwarm='echo "clearing all swarm tunnels." ; kill -9 `ps aux|grep 2375\: | grep -v grep | awk '"'"'{printf("%s ",$2);}'"'"'`'
- Run either
setupSwarmGamma
orsetupSwarmDelta
in one shell
- Note: you will need to dedicate one shell to run this command, it is a blocking call. To stop the tunnel simply press
control + c
in this shell
- In any other shell you are now able to run any
docker
commands:
-
docker ps
- list all running containers across the entire environment -
docker info
- list all docks with nice info
docker info | grep -B5 <org_github_id>