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{} containersInspected := []docker.Container{}
hosts := map[string][]docker.Container{} hosts := map[string][]docker.Container{}
for _, container := range containerList { for _, container := range containerList {
containerInspected, _ := provider.dockerClient.InspectContainer(container.ID) if(container.Labels["traefik.enable"] != "false"){
containersInspected = append(containersInspected, *containerInspected) containerInspected, _ := provider.dockerClient.InspectContainer(container.ID)
hosts[getHost(*containerInspected)] = append(hosts[getHost(*containerInspected)], *containerInspected) containersInspected = append(containersInspected, *containerInspected)
hosts[getHost(*containerInspected)] = append(hosts[getHost(*containerInspected)], *containerInspected)
}
} }
templateObjects := struct { templateObjects := struct {

View file

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