advancedTop 100 Interview Questions

Why might EXPOSE alone not be enough to access a container's service?

EXPOSE is purely documentation/metadata about which port the application listens on inside the container — it does not publish or map that port to the host. Actual host accessibility requires `-p`/`--publish` at `docker run` time (or a `ports:` mapping in Compose).

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What is BuildKit, and how does it differ from the legacy builder?← Back to all Docker questions