Skip to content

Instantly share code, notes, and snippets.

@megastef
Created January 11, 2016 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save megastef/4910395383572c92ca27 to your computer and use it in GitHub Desktop.
Save megastef/4910395383572c92ca27 to your computer and use it in GitHub Desktop.
Create a Docker Swarm with docker-machine and enable dockerd Unix Sockets
export SWARM_TOKEN=$(docker run swarm create)
docker-machine create \
-d virtualbox \
--engine-env 'DOCKER_OPTS="-H unix:///var/run/docker.sock"' \
--swarm \
--swarm-master \
--swarm-discovery token://$SWARM_TOKEN \
swarm-master
for NODE in {1..3};
do
docker-machine create \
--engine-env 'DOCKER_OPTS="-H unix:///var/run/docker.sock"' \
-d virtualbox \
--swarm \
--swarm-discovery token://$SWARM_TOKEN \
"swarm-agent-$NODE"
done
@megastef
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment