What does the -p flag do in the docker run command?

Docker Fundamentals Easy

Docker Fundamentals — Easy

What does the -p flag do in the docker run command?

Key points

  • The -p flag facilitates port mapping between the host and container
  • It enables communication between the host machine and the container
  • This is essential for accessing services running inside the container

Ready to go further?

Related questions