Docker Diagnosis Scratchpad

I installed WSL2 on my Windows desktop at Docker Desktop’s suggestion, and of course everything failed forever, getting 500s trying to load anything. What do?

  • docker container ls to see if the OpenEMR container is either up or restarting.
  • Sometimes if you’re working without docker-compose’s help, you might find docker compose ls -a more relevant, which will find even a stopped container.
  • Connect to the container with docker exec -it <containerid-prefix> /bin/sh and go look at the PHP logs. tail -f /var/log/apache2/error.log will give you a running report on what PHP is griping about.
  • If that’s complete nonsense, maybe something went wrong in container build? docker logs <containerid-prefix> will give you the recent stdout of the container scripts, which may include valuable clues about what might not have downloaded or what parts of the build may have gone awry.

In my case, my Docker’s DNS was somehow busted and set to “127.0.0.11” for baffling reasons. Forcing a sensible default in Docker’s daemon.json resolved the issue. I worked this out when I spotted “api.github.com” not resolving in the container, causing easydev’s build to collapse. Verified the container couldn’t see that domain, verified my desktop could, went hunting for resolv.conf, got angry and threw things, et cetera.

But I thought someone might appreciate notes about how to approach container shenanigans beyond “okay, up it again and maybe it’ll be better”.

2 Likes