TIL: Docker Debugging

I can’t believe how much I suffered trying to find out IP addresses & such inside my docker containersđŸ˜‚ - there’s no ipconfig or ifconfig in there.

I’m still trying to get two containers playing well together, using docker compose. Hopefully will come right soon.

Anyway, onto what we actually learnt while browsing the youtubes


  • docker inspect [container-id OR name] - Came in very handy when I was trying to figure out the network configs, and why things weren’t playing nice
  • docker volumes - Learning about persistent data in docker. And how/where your host machine shares it
  • docker logs -f [container-id OR name] - Was super handy when trying to figure out error messages from the db container while trying to set up a connection from the app.
  • docker system prune --force --volumes - I’m yet to learn exactly what this does

Dockerfile

    ports:
      - "4000:4000"
    expose:
      - "4000"