Services and User Management
A PostgreSQL container must be reachable on port 5432 only by processes running on the Docker host itself. It must not be reachable from other machines on the network. Which option publishes the port correctly?
Show the answer
Correct answerD. -p 127.0.0.1:5432:5432
Putting the loopback address first in the mapping (ip:host_port:container_port) binds the published port to 127.0.0.1 only. A plain 5432:5432 mapping binds to all host interfaces, which would expose the database to the network.