I have a project with docker containers that make a huge logs at /var/lib/docker/containers
when /var/lib/docker/containers/containerid.json.log
is deleted, the space still not free.
for some reasons docker-deamon
should not be restarted.
if docker-daemon
restart or if server rebooted the problem will be solved but I can't do it and the container should be online every time.
what should I do?
Asked
Active
Viewed 127 times
0

Antonio Petricca
- 8,891
- 5
- 36
- 74

rezshar
- 570
- 1
- 6
- 20
-
Use [log rotation](https://stackoverflow.com/a/32091923/724039) ? – Luuk Apr 04 '22 at 07:56
-
Possible duplicate: https://stackoverflow.com/q/42510002/596285 – BMitch Apr 04 '22 at 08:19
1 Answers
1
For a oneshot cleanup you should use:
sudo truncate -s 0 /var/lib/docker/containers/containerid.json.log

Antonio Petricca
- 8,891
- 5
- 36
- 74