traefik.enable label
This commit is contained in:
parent
e2d2f1f1d1
commit
0ae325c080
2 changed files with 15 additions and 13 deletions
|
@ -82,10 +82,12 @@ 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 {
|
||||||
|
if(container.Labels["traefik.enable"] != "false"){
|
||||||
containerInspected, _ := provider.dockerClient.InspectContainer(container.ID)
|
containerInspected, _ := provider.dockerClient.InspectContainer(container.ID)
|
||||||
containersInspected = append(containersInspected, *containerInspected)
|
containersInspected = append(containersInspected, *containerInspected)
|
||||||
hosts[getHost(*containerInspected)] = append(hosts[getHost(*containerInspected)], *containerInspected)
|
hosts[getHost(*containerInspected)] = append(hosts[getHost(*containerInspected)], *containerInspected)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
templateObjects := struct {
|
templateObjects := struct {
|
||||||
Containers []docker.Container
|
Containers []docker.Container
|
||||||
|
|
20
traefik.toml
20
traefik.toml
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue