QuestionQ209

Application Deployment and Security

An engineer is building a Docker container for a Python application. For security reasons, the application must be accessible only on port 5001. Which line should be added to the Dockerfile to accomplish this?

  • A ADD PORT 5001
  • B ENTRYPOINT 5001
  • C EXPOSE 5001
  • D PORT SRC 5001
Explanation

EXPOSE 5001 declares that the containerized application listens on TCP port 5001. Dockerfile EXPOSE documents the intended listening port; publishing and network restrictions are configured at container runtime.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!