Docker WTFs

Logs

Logs do take up disk space:

kamil@i-95bf0212:~$ sudo docker logs app 2>&1 | wc -c
2024449872

How much is that exactly?

>>> 2024449872 / gb
1.885415866971016

Well, actually, a tad bit more than that, as Docker stores logs serialised as JSON:

kamil@i-123ab212:~$ sudo find /var/lib/docker -name "*json.log" | sudo xargs du -h
3.3G    /var/lib/docker/containers/92dd9ca256a98a4ee990076ba804e16b96f92301b8156e1143484cd3dcd95c7e/92dd9ca256a98a4ee990076ba804e16b96f92301b8156e1143484cd3dcd95c7e-json.log

Remedy? truncate -s0.


See this as plaintext. Get the permalink. Check out related. Go home.