traefik.enable label

This commit is contained in:
emile 2015-09-10 17:31:52 +02:00
parent e2d2f1f1d1
commit 0ae325c080
2 changed files with 15 additions and 13 deletions

View file

@ -82,9 +82,11 @@ func (provider *DockerProvider) loadDockerConfig() *Configuration {
containersInspected := []docker.Container{}
hosts := map[string][]docker.Container{}
for _, container := range containerList {
containerInspected, _ := provider.dockerClient.InspectContainer(container.ID)
containersInspected = append(containersInspected, *containerInspected)
hosts[getHost(*containerInspected)] = append(hosts[getHost(*containerInspected)], *containerInspected)
if(container.Labels["traefik.enable"] != "false"){
containerInspected, _ := provider.dockerClient.InspectContainer(container.ID)
containersInspected = append(containersInspected, *containerInspected)
hosts[getHost(*containerInspected)] = append(hosts[getHost(*containerInspected)], *containerInspected)
}
}
templateObjects := struct {

View file

@ -1,18 +1,18 @@
port = ":8001"
graceTimeOut = 10
# [docker]
# endpoint = "unix:///var/run/docker.sock"
# watch = true
# domain = "toto.fr"
# filename = "docker.tmpl"
[marathon]
endpoint = "http://127.0.0.1:8080"
networkInterface = "eth0"
[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
domain = "toto.fr"
filename = "marathon.tmpl"
filename = "docker.tmpl"
# [marathon]
# endpoint = "http://127.0.0.1:8080"
# networkInterface = "eth0"
# watch = true
# domain = "toto.fr"
# filename = "marathon.tmpl"
[web]
address = ":8010"