Docker randomly hangs

Dear community,

Recently, I found my docker containers will randomly hang forever after running normally for several hours, and I have to kill and restart them. I am using Windows 11 + Ubuntu 18.04 + VSCode + Docker Desktop.

I have been using the docker to run my codes without any problems for around one year, and this hanging problem just appeared several weeks ago. Interestingly, docker can work normally on another workstation that has similar hardware and software.

I have tried to search for methods to fix it and the following methods do not work for me:

  • Use the latest and some old version of docker.
  • Reinstall the docker and clean the containers, images, and caches.
  • Reinstall the Ubuntu and VScode.

I would like to know how to fix this problem.