Created
June 4, 2016 11:59
-
-
Save scmrus/2ce51025d64c039ba1b88b3a75d17968 to your computer and use it in GitHub Desktop.
Service discovery with Docker, Registrator and Consul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
docker stop consul | |
docker rm consul | |
docker run -d -h node1 --name consul -v /home/fritz/consul:/data \ | |
-p 10.0.2.15:8300:8300 \ | |
-p 10.0.2.15:8301:8301 \ | |
-p 10.0.2.15:8301:8301/udp \ | |
-p 10.0.2.15:8302:8302 \ | |
-p 10.0.2.15:8302:8302/udp \ | |
-p 10.0.2.15:8400:8400 \ | |
-p 10.0.2.15:8500:8500 \ | |
-p 172.17.42.1:53:53/udp \ | |
progrium/consul -server -advertise 10.0.2.15 -bootstrap -ui-dir /ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
docker run \ | |
-p 8400:8400 \ | |
-p 8500:8500 \ | |
-p $DOCKER_BRIDGE_IP:53:53/udp \ | |
-d \ | |
--name consul \ | |
-h node1 \ | |
progrium/consul \ | |
-server \ | |
-bootstrap \ | |
-ui-dir /ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
docker run \ | |
-d \ | |
-v /var/run/docker.sock:/tmp/docker.sock \ | |
--name registrator \ | |
-h node1 \ | |
gliderlabs/registrator:master \ | |
-ip $SERVICE_IP \ | |
consul://172.30.14.126:8500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment