A container described in docker-compose.yml
uses logging extension to send log to a fluentd container.
version: "2"
services:
fluentd:
image: fluent/fluentd:v0.14.8
container_name: fluentd
nginx:
image: nginx:1.11.5
container_name: nginx
links:
- fluentd
logging:
driver: fluentd
options:
fluentd-address: fluentd:24224
But this configuration does not work, as the fluentd-address
is seen externally by the host (aka the host) and not from within the nginx container.
So it requires a way to know the IP address of container outside the container but in a compatible way for docker-compose, any idea ?
With the latest docker-compose it wont work on links, you need to use docker networks.
And actually you can omit the
fluentd-address
because fluentd log driver autodiscover for anyting that listening on 24224 in that case