'docker ps' hangs forever after server res

2019-04-30 03:53发布

问题:

After server restart docker looks alive but all commands like docker ps hang forever until I press Ctrl+C. What can be wrong?

Docker version 1.12.6, build 7392c3b/1.12.6 Linux ip-10-0-1-124 4.4.10-22.54.amzn1.x86_64

回答1:

It turned out instance had uptime for over a year, many application releases were installed, /var/lib/docker/devicemapper folder contained hundreds of items that apparently refer to older abandoned containers.

I saw the process of eternal reading all this data while dockerd -D command that runs docker interactively for debugging.

I removed /var/lib/docker and /var/run/docker and re-installed docker and containers on my box, the problem was resolved.

Feels like I need a script that would periodically remove obsolete items from docker internals.



标签: docker