From the course: Learning Docker
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Binding ports to your container - Docker Tutorial
From the course: Learning Docker
Binding ports to your container
- [Instructor] Up to this point, all of the containers we've created use data imports within themselves. This is somewhat useful, but not nearly as useful as being able to access data imports from your own computer into those containers. Let's learn how to do that. First, let's explore accessing container network services from your host. Docker provides the ability to access network ports within the container, with something called port binding. This feature allows Docker to take a port on your machine, and map it to a port within the container. This section contains a docker file that updated our little server from earlier. That docker file is called web hyphen server dot docker file. First, let's build an image from it, called our web server, with docker build dash t, our web server. Then the dash f option, and then the name of the Docker file, which is called web hyphen server dot Dockerfile. And then…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Exploring the Docker CLI3m 1s
-
(Locked)
Create a Docker container6m 58s
-
(Locked)
Create a Docker container: The short way2m 9s
-
(Locked)
Create a Docker container from Dockerfiles, part 12m 46s
-
(Locked)
Create a Docker container from Dockerfiles, part 22m 37s
-
(Locked)
Interact with your container5m 9s
-
(Locked)
Stopping and removing the container5m 41s
-
(Locked)
Binding ports to your container4m 36s
-
(Locked)
Saving data from containers5m 39s
-
(Locked)
Introducing the Docker Hub1m 23s
-
(Locked)
Pushing images to the Docker registry3m 13s
-
(Locked)
Checking your images in Docker Hub2m 44s
-
(Locked)
Challenge: Starting NGINX1m 16s
-
(Locked)
Solution: Starting NGINX5m 18s
-
-
-
-