rancher / vagrant

Vagrant file to stand up a Local Rancher install with 3 nodes
81 stars 56 forks source link

Expose Docker API to host network #11

Closed LLParse closed 7 years ago

LLParse commented 7 years ago

Useful for interacting with the various daemons from the host machine. Here's some simple aliasing to go with it:

for x in $(seq 1 9); do
  for t in s n server node; do
    if [ "$t" == "s" ] || [ "$t" == "server" ]; then
      i=10$x
    else
      i=11$x
    fi
    alias "d$t$x"="export DOCKER_HOST=\"tcp://172.22.101.$i\"; \$@"
  done
done

Stick this in ~/.bash_profile or similar and reap the benefits: ds1 docker ps; dn1 docker ps; dnode2 docker ps; docker ps