charm should have options to rotate docker registry log file

Bug #1844602 reported by Thomas Cuthbert
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Docker Registry Charm
Fix Released
Medium
Tim Van Steenburgh

Bug Description

the registry log file can grow quite large and requires manual truncation. The charm should have options to control rotating the logs.

-rw-r----- 1 root root 3.3G Sep 19 01:48 5bfe5f9be6d1819f245adf26598874a68093390764456c84eb870f201760658b-json.log

Using something like https://docs.docker.com/config/containers/logging/json-file/

Tags: canonical-is
Changed in layer-docker-registry:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Haw Loeung (hloeung) wrote :

This has bitten us elsewhere as well. Any chance this could be bumped to something other than Wishlist?

Revision history for this message
Haw Loeung (hloeung) wrote :

Quick search shows there's an option to keep the size constant and rotate out keeping N copies:

daemon.json:

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

Or running dockerd with '--log-opt max-size=10m --log-opt max-file=3'

Revision history for this message
Haw Loeung (hloeung) wrote :

Obviously, we want to keep more that 30m worth. Also, FWIW, the path of these logs are:

| /var/lib/docker/containers/.../

Changed in layer-docker-registry:
importance: Wishlist → Medium
tags: added: canonical-is
Changed in layer-docker-registry:
status: Triaged → In Progress
assignee: nobody → Tim Van Steenburgh (tvansteenburgh)
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

PR up for review/feedback: https://github.com/juju-solutions/layer-docker/pull/140/

Still needs tests.

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Haw,

> Or running dockerd with '--log-opt max-size=10m --log-opt max-file=3'

FYI, you can do this today with:

juju config docker-registry docker-opts="--log-opt max-size=10m --log-opt max-file=3"

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :
Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

Both PRs from comment 6 are now merged in their master branches.

Changed in layer-docker-registry:
status: In Progress → Fix Committed
Changed in layer-docker-registry:
milestone: none → 1.17
Changed in layer-docker-registry:
status: Fix Committed → Fix Released
George Kraft (cynerva)
Changed in layer-docker-registry:
status: Fix Released → Fix Committed
milestone: 1.17 → 1.18+ck1
Revision history for this message
George Kraft (cynerva) wrote :

This didn't actually go out with 1.17. I've set milestone to 1.18+ck1 and we're working to include docker-registry in the release this time.

Cherry-pick to stable: https://github.com/charmed-kubernetes/docker-registry-charm/commit/b90c1fed6bdc4762de4fabefa37c4e7bcb396904

Changed in layer-docker-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.