Univention Bugzilla – Bug 56130
incompatible defaults in UCR template daemon.json
Last modified: 2024-03-28 09:08:11 CET
Currently, two options for the logging driver (below the "log-opts" key) are hard-coded into /etc/docker/daemon.json. Those options are however not compatible with all logging drivers: ----------------------------------------------------------------------------- # cat /etc/docker/daemon.json { "bip": "172.17.42.1/16", "live-restore": true, "log-driver": "json-file", "log-opts": { "max-file": "4", "max-size": "10m" } } # ucr set docker/daemon/default/opts/log-driver=journald # cat /etc/docker/daemon.json { "bip": "172.17.42.1/16", "live-restore": true, "log-driver": "journald", "log-opts": { "max-file": "4", "max-size": "10m" } } # systemctl restart docker.service Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details. # grep max-file /var/log/syslog Jun 9 08:02:40 self-disclosure1 dockerd[19391]: failed to start daemon: failed to set log opts: unknown log opt 'max-file' for journald log driver Jun 9 08:02:42 self-disclosure1 dockerd[19404]: failed to start daemon: failed to set log opts: unknown log opt 'max-file' for journald log driver ----------------------------------------------------------------------------- I wrote a patch for the UCR template that enables "log-opts" according to the documentation of each logging driver: ----------------------------------------------------------------------------- # ucr set docker/daemon/default/opts/log-driver=json-file # cat /etc/docker/daemon.json { "bip": "172.17.42.1/16", "live-restore": true, "log-driver": "json-file", "log-opts": { "env": "DOCKER_HOST_NAME", "labels": "APP_NAME,APP_VERSION,UCS", "max-file": "4", "max-size": "10m", "tag": "{{.ImageName}}/{{.Name}}/{{.ID}}" } } # systemctl restart docker.service && echo OK OK # ucr set docker/daemon/default/opts/log-driver=journald # cat /etc/docker/daemon.json { "bip": "172.17.42.1/16", "live-restore": true, "log-driver": "journald", "log-opts": { "env": "DOCKER_HOST_NAME", "labels": "APP_NAME,APP_VERSION,UCS", "tag": "{{.ImageName}}/{{.Name}}/{{.ID}}" } } # systemctl restart docker.service && echo OK OK # ucr set docker/daemon/default/opts/log-driver=fluentd # cat /etc/docker/daemon.json { "bip": "172.17.42.1/16", "live-restore": true, "log-driver": "fluentd", "log-opts": { "env": "DOCKER_HOST_NAME", "fluentd-address": "unix:///var/run/fluentd.sock", "fluentd-sub-second-precision": "true", "labels": "APP_NAME,APP_VERSION,UCS", "tag": "docker-logs" } } # systemctl restart docker.service && echo OK OK ----------------------------------------------------------------------------- The ["log-opts"]["labels"] configuration is meant to work with Bug <to-be-created>.
The ["log-opts"]["labels"] configuration is meant to work with Bug #56131. The MR is: https://git.knut.univention.de/univention/ucs/-/merge_requests/782
IMHO, this should be implemented for the 5.2-0 release, because the change requires a restart of the Docker daemon to take effect. Something we should not do in an errata release.