Networking containers enable a containerized app to communicate with the outside world. In many cases a given app may be dependent on a database or multiple services. We can "expose" to enable these interactions.
Expose
Dockerfile
dockerfile
...EXPOSE 8080...
We can also expose multiple ports
dockerfile
...EXPOSE 80EXPOSE 8080EXPOSE 5432...
CLI and Run Time
At docker start
At docker run
docker run --expose=8080 --name="port-demo" test