To illustrate my problem, please see this:
docker run --hostname=rogier --rm=true --log-driver=syslog --log-opt syslog-address=udp://:514 --name rogier alpine ping 127.0.0.1
I run a container which outputs the result of the ping command. I also specified remote logging through syslog. This all works and the container logs are indeed sent to syslog. Here is an example:
Jan 20 10:13:09 localhost.localdomain 3db116852935: 64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.096 ms Jan 20 10:13:10 localhost.localdomain 3db116852935: 64 bytes from 127.0.0.1: seq=3 ttl=64 time=0.079 ms
Now my problem is: I would expect the value
3db116852935 to be
rogier (due to the fact that I explicitly set the container hostname). For some reason I still get a dynamic generated hostname here.
Sorry, should have read the docs a bit better. Turns out that I can easily solve it by specifying tags:
Another question: do I for some reason have control of the first part:
localhost.localdomain? Can I overrule the docker engine w.r.t. this value?