Docker WTFs


Logs do take up disk space:

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

How much is that exactly?

>>> 2024449872 / gb

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.