G

Gopal Sharma • 38.32K Points
Coach

Q. Which of the following is the correct way to expose a Docker container’s port to the host?

  • (A) docker run -p 8080:80 container_name
  • (B) docker run --port 8080:80 container_name
  • (C) docker expose -p 8080:80 container_name
  • (D) docker bind 8080:80 container_name
  • Correct Answer - Option(A)
  • Views: 17
  • Filed under category Docker

Explanation by: Gopal Sharma
'docker run -p 8080:80 container_name' is the correct command to expose a port from the container to the host.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics