I’m trying to get the json logging driver to compress rotated files by including the compress
key in log-opts
of /etc/docker/daemon.json
. The file looks like this:
{
...
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "10",
"compress": "true"
}
}
After editing the file, I ran the following console commands and got the following outputs:
$: docker-compose down
# containers all go down without problems.
$: systemctl daemon-reload
$: systemctl restart docker
# Output:
# Job for docker.service failed because the control process exited with error code.
# See "systemctl status docker.service" and "journalctl -xe" for details.
The output of systemctl status docker.service
is pretty unhelpful. It reports (breif version:)
docker.service: Failed with result 'exit-code'.
and journalctl -xe
gives me:
-- Unit docker.service has failed
--
-- The result is RESULT.
If I remove the compress key-value pair from daemon.json
, everything runs just fine. Given that the result code reporting above looks suspiciously broken, I’m willing to bet I’ve run across a bug.
Before I create an issue, I wanted to ping the community to see if anyone has had a similar experience and resolved it. Any help is greatly appreciated!