Docker and CI/CD · Junior · Question 27 of 75
Inside a container, what does localhost refer to?
- 1The first container started on the network
- 2The host machine that runs Docker
- ✓Correct answer: The container itself, not the host machine
Explanation
Each container has its own network namespace. To reach a service on the host, Docker Desktop provides host.docker.internal; other containers are reached by name.