Skip to main content

What does docker run -p 8080:80 mean?

Entry Docker
Quick Answer -p 8080:80 maps port 80 inside the container to port 8080 on your host machine. Traffic hitting localhost:8080 on your machine is forwarded to port 80 in the container. Format is always host:container. Without -p, the container's port is unreachable from outside.

Answer

It maps host port 8080 to container port 80, allowing external traffic from the host to reach the container.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice