6

docker error when using --log-driver="syslog" on OS X

I am trying to learn how to use docker containers on OS X (10.10.3), I understand the differences with the standard Linux implementation ( need boot2docker VM) and I wonder if there is any impact on the way I can log messages with syslog

when I start a container with the --log-driver="syslog" option, the container is created but I get an error upon start

~$ docker run --log-driver="syslog" --name daemon_dwayne -d ubuntu /bin/sh -c "while true; do echo hello_world; sleep 2; done;"
1f623793049916d5c....
FATA[0000] Error response from daemon: Cannot start container 1f623793049916d5....: Unix syslog delivery error

this is running fine on a Linux machine... thanks for any hint

BMW
  • 42,880
  • 12
  • 99
  • 116

1 Answers1

9

Boot2docker runs in a small linux VM. By default, syslog isn't running in the VM. You can turn it on by running syslogd in the VM e.g:

$ boot2docker ssh
...
docker@boot2docker:~$ syslogd

If you then try running your container again it should work.

You can make this change permanent by calling syslogd from the file /var/lib/boot2docker/bootsync.sh inside the boot2docker VM, which boot2docker will execute before starting Docker.

Adrian Mouat
  • 44,585
  • 16
  • 110
  • 102
  • thanks a lot... "By default, syslog isn't running in the VM" forget to check it !!! –  May 04 '15 at 17:26
  • and in boot2docker vm, the syslog output is attached to `/var/log/messages` – BMW Jul 31 '15 at 14:15
  • do you know how to link the syslog output to something else than /var/log/messages. I tried to use a configuration file /etc/syslog.conf but it looks like it's not working. Any idea ? – Hervé Darritchon Aug 06 '15 at 08:48