From d7c6d0ece9c0d007f8f8f4da6bca103713527dc2 Mon Sep 17 00:00:00 2001 From: Joseph Heenan Date: Sat, 28 Jul 2018 10:40:24 +0900 Subject: [PATCH] Limit amount of output from docker when restarting container 'docker-compose restart server' seems to replay all the logs, which on my mac had reached 125M and it took quite a while to replay that much data to the terminal. Found on: https://github.com/docker/compose/issues/1083#issuecomment-299342320 and documented here: https://docs.docker.com/config/containers/logging/json-file/#options --- docker-compose-dev.yml | 6 ++++++ docker-compose.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 7cac62b0..dc614558 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -39,3 +39,9 @@ services: - microauth:microauth depends_on: - mongodb + logging: + # limit logs retained on host + driver: "json-file" + options: + max-size: "500k" + max-file: "5" diff --git a/docker-compose.yml b/docker-compose.yml index fc070190..aced4427 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,3 +29,9 @@ services: - microauth:microauth depends_on: - mongodb + logging: + # limit logs retained on host + driver: "json-file" + options: + max-size: "500k" + max-file: "5"