dockercon is a tool to switch between docker contexts faster.
Copy dockercon.py somewhere into your path
cp ./dockercon.py /usr/local/bin/dockerconTo add a context:
dockercon -a mydockerhst-local --host ssh://user@192.168.1.1 --stack swarmTo switch to a context:
dockercon mydockerhst-localTo see the saved context:
$ dockerconTo get help:
$ dockercon -h
usage: dockercon [-h] [-d <NAME>] [-a <NAME>] [--host <HOST>] [--stack <STACK>] [<NAME>]
dockercon is a tool to switch between docker contexts faster.
positional arguments:
<NAME> Switch to context '<NAME>'
optional arguments:
-h, --help show this help message and exit
-d <NAME> delete context <NAME>
-a <NAME> add context <NAME>
--host <HOST> <HOST> to use with a new context
--stack <STACK> orchestrator <STACK> to use with a new context