Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to Docker!
You have completed Introduction to Docker!
Preview
Before you can make a network connection to a service running on a container, you need to expose the port the service is running on. The EXPOSE instruction allows you to do that.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
before you can make a network connection
to a service running on a container,
0:00
you need to expose the port
the service is running on.
0:02
The EXPOSE instruction
allows you to do that.
0:05
When running the container
with docker run,
0:09
we use the -p option to publish the
exposed port to a port on the Docker host.
0:12
So to publish the exposed port
8080 as port 8080 on our host,
0:18
we run docker run -p
8080:8080 sample-web-app.
0:24
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up