arrow_back
Back

Dockerfile EXPOSE: documenting container ports

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

EXPOSE informs Docker that the container listens on the specified port(s). Docker uses this when linking containers or publishing ports with -P in docker run. EXPOSE does not publish the port by itself — you still need -p or -P at runtime.

Example:

EXPOSE 3000
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Dockerfile ENV: environment variables in images

arrow_forward