A container described in docker-compose.yml uses logging extension to send log to a fluentd container.
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 ?
ports option to expose a port for the logging daemon, and use the host’s IP address (or
localhost, since the Docker daemon is interpreting it).
(You’ll need a
ports option for your nginx container too. The Docker-assigned private IP address isn’t particularly useful for most things.)
I am running a docker swarm and exposed the port/udp. However sending messages to localhost does not work whereas 0.0.0.0 works. Any idea why?
Look at this example, how the fuentd can be used for logging aggregation using docker-compose in Docker SWARM mode