apps:docker:troubleshooting
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
apps:docker:troubleshooting [2025-02-01 19:39] – add disk usage snippets Manuel Frei | apps:docker:troubleshooting [2025-02-04 17:09] (current) – add xargs data Manuel Frei | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Docker Troubleshooting ====== | ====== Docker Troubleshooting ====== | ||
- | ===== Disk Usage ===== | + | ===== Disk Usage (MergeDir) |
+ | |||
+ | If you run out of disk usage and it's not the data from your volumes, maybe a container is writing data to the overlay file system. This data is placed in the merge directory. Try the following snippets to show the size of the merge directory for all the containers. | ||
<code bash> | <code bash> | ||
Line 16: | Line 18: | ||
</ | </ | ||
+ | This is how the output could be displayed. | ||
<code - Example> | <code - Example> | ||
root@server: | root@server: | ||
Line 52: | Line 54: | ||
container_pid=" | container_pid=" | ||
nsenter -n -t " | nsenter -n -t " | ||
+ | </ | ||
+ | |||
+ | ===== Logs ===== | ||
+ | |||
+ | ==== Add Local Timestamp to Container Logs ==== | ||
+ | |||
+ | If a container is logging without a timestamp or with an unknown time zone, you can add a timestamp while watching the logs. | ||
+ | <code bash> | ||
+ | docker logs mycontainer -n 0 -f | xargs -IL date +' | ||
+ | </ | ||
+ | |||
+ | In case you want to catch the stderr logs, too | ||
+ | <code bash> | ||
+ | docker logs mycontainer -n 0 -f 2>&1 | xargs -IL date +' | ||
+ | </ | ||
+ | |||
+ | <code - Example> | ||
+ | root@server: | ||
+ | [2025-02-04T16: | ||
+ | [2025-02-04T16: | ||
+ | [2025-02-04T16: | ||
+ | [2025-02-04T16: | ||
+ | [2025-02-04T16: | ||
+ | [2025-02-04T16: | ||
</ | </ | ||
apps/docker/troubleshooting.1738435167.txt.gz · Last modified: 2025-02-01 19:39 by Manuel Frei