Docker: Added warning if network could not be found (#1310)
* Added warning if network could not be found * Removed regex import from master * Corrected wrong function call
This commit is contained in:
parent
b02393915e
commit
a73fee50dc
2 changed files with 3 additions and 1 deletions
|
@ -844,7 +844,7 @@ Labels can be used on containers to override default behaviour:
|
|||
- `traefik.frontend.passHostHeader=true`: forward client `Host` header to the backend.
|
||||
- `traefik.frontend.priority=10`: override default frontend priority
|
||||
- `traefik.frontend.entryPoints=http,https`: assign this frontend to entry points `http` and `https`. Overrides `defaultEntryPoints`.
|
||||
- `traefik.docker.network`: Set the docker network to use for connections to this container
|
||||
- `traefik.docker.network`: Set the docker network to use for connections to this container. If a container is linked to several networks, be sure to set the proper network name (you can check with docker inspect <container_id>) otherwise it will randomly pick one (depending on how docker is returning them). For instance when deploying docker `stack` from compose files, the compose defined networks will be prefixed with the `stack` name.
|
||||
|
||||
If several ports need to be exposed from a container, the services labels can be used
|
||||
- `traefik.<service-name>.port=443`: create a service binding with frontend/backend using this port. Overrides `traefik.port`.
|
||||
|
|
|
@ -550,6 +550,8 @@ func (provider *Docker) getIPAddress(container dockerData) string {
|
|||
if network != nil {
|
||||
return network.Addr
|
||||
}
|
||||
|
||||
log.Warnf("Could not find network named '%s' for container '%s'! Maybe you're missing the project's prefix in the label? Defaulting to first available network.", label, container.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue