Last active
July 27, 2017 20:46
-
-
Save populov/3e5b8f9a3190e1df32a6976c700aea9b to your computer and use it in GitHub Desktop.
Docker consul DNS
This file contains hidden or 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/bash | |
| # run with sudo! | |
| echo "server=/service.docker/127.0.0.1#8600" > /etc/NetworkManager/dnsmasq.d/consul-tld | |
| echo "address=/.lo/127.0.0.1" > /etc/NetworkManager/dnsmasq.d/lo-tld | |
| service network-manager restart |
This file contains hidden or 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
| version: '2.1' | |
| services: | |
| consul: | |
| image: gliderlabs/consul-server | |
| container_name: consul | |
| network_mode: host | |
| restart: always | |
| command: -bootstrap -domain=docker -advertise=127.0.0.1 | |
| registrator: | |
| container_name: registrator | |
| image: gliderlabs/registrator:latest | |
| network_mode: host | |
| restart: always | |
| volumes: | |
| - /var/run/docker.sock:/tmp/docker.sock | |
| command: -internal consul://localhost:8500 | |
| depends_on: | |
| - consul |
This file contains hidden or 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/bash | |
| # Run consul | |
| docker run -d \ | |
| --name=consul \ | |
| --net=host \ | |
| --restart=always \ | |
| gliderlabs/consul-server \ | |
| -bootstrap -domain=docker -advertise=127.0.0.1 | |
| # Run registrator | |
| docker run -d \ | |
| --name=registrator \ | |
| --net=host \ | |
| --restart=always \ | |
| --volume=/var/run/docker.sock:/tmp/docker.sock \ | |
| gliderlabs/registrator:latest \ | |
| -internal consul://localhost:8500 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment