I set up Docker CE on my Ubuntu 18.04 server and then installed a new Jenkins container, which worked fine for about two weeks.
However, after that period, I ran into a problem. When I used the command “docker ps,” it showed an empty list, even though the Jenkins container was active and working as expected (just like before). I tried other commands like “docker ps -a” and “docker images,” but they also gave empty outputs. Even after restarting the server, the problem persisted, and the list of containers remained empty.
So, I decided to uninstall and reinstall Docker. Initially, after the reinstallation, “docker ps” displayed the containers, making me think the issue was fixed. Unfortunately, the problem came back, and once again, “docker ps” shows an empty list. Any insights or suggestions would be really helpful.
Solution
Here is how I solved this issue…
Execute the following sequence of commands:
- Stop the Docker service:
sudo service docker stop
- Identify the dockerd process:
ps aux | grep "dockerd"
- Terminate the dockerd process using its PID (replace
{paste_dockerd_pid_here}
with the actual PID):sudo kill {paste_dockerd_pid_here} -9
- Restart the Docker service:
sudo service docker start
Or:sudo systemctl restart docker # For Linux