SpinTheMic
Pro

Interview practice question

Two containers cannot talk to each other

Cloud & DevOps · Docker · Beginner

Your app container cannot connect to the database container using "localhost." What is wrong?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • localhost = the container itself.
  • Put both on same user-defined network.
  • Use service/container name as hostname.
  • Compose does this automatically.
  • Use container port, not published port.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics