Last active
August 29, 2015 14:12
-
-
Save skippy/29d6c579103535f18fcf to your computer and use it in GitHub Desktop.
modifying the docker host's /etc/hosts file with the location of a private docker-registry so we don't need to restart the docker daemon (and force all the containers to restart0
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
# run from a coreos fleet file; change as you see fit | |
# NOTE: this shares the /etc folder with docker; ugh! | |
# using multiple -v doesn't seem to work (as consul-template | |
# does atomic writes, which requires writing a tmp file | |
# then moving it). | |
docker run --rm \ | |
--name docker-registry \ | |
-e SERVICE_IGNORE=1 \ | |
-v /etc:/configs \ | |
skippy/consul-template \ | |
-consul ${COREOS_PRIVATE_IPV4}:8500 \ | |
-template "/configs/hosts.ctmpl:/configs/hosts" |
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
# save at /etc/hosts.ctmpl | |
{{range service "private-registry"}} | |
{{.Address}} {{.Name}}.service.consul {{.Name}}.service.consul{{end}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment