Need Assistance?

support@tutorialshub.in

Docker Images and Dockerfiles

EXPOSE and Port Publishing

ADVERTISEMENT
Docker Free Lesson
5 min read
ADVERTISEMENT

EXPOSE Is Documentation

EXPOSE records the port a containerized application intends to use; it does not make that port reachable from the host by itself. Host access is created with docker run -p HOST:CONTAINER.

For example, an application listening on port 3000 inside a container can be published on host port 8080 using -p 8080:3000.

ADVERTISEMENT