Skip to content

Docker logs size should be limited #76

Open
@sgoumaz

Description

@sgoumaz

Currently we run with the Docker daemon defaults, and logs have eaten up system volumes on Addmin's machines.

Proposed solution:

  • Add a new "common" docker-compose file to be invoked together with each specific file (docker-compose merges them)
  • In that file specify the logging options that limit file size and number (see reference), and assign those to a YAML anchor
  • Refer to the created anchor for each service in all the existing docker-compose files

Alternative: set global Docker daemon setting in /etc/docker/daemon.json:

{
  "log-driver": "json-file",
  "log-opts": {"max-size": "10m", "max-file": "1"}
}

Q: did we decide to use the "local" driver instead? (JSON is default and recommended to use log contents elsewhere, but local is smaller and faster)


⚠️ after changing the config, containers have to be recreated for the new settings to be used; one way to do it is with docker-compose up --force-recreate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions