From the course: Docker Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Exposing container ports between containers - Docker Tutorial
From the course: Docker Essential Training
Exposing container ports between containers
- [Instructor] Docker makes it easy to expose network ports within containers to other containers, or even to your local machine. Let me show you what I mean. We have our two terminals from last time, each running a container. The top terminal is running container-a and the bottom is running container-b. In container-a, I'm going to use a program called Netcat, or nc, to start a really simple TCP server on port 80. The server will do nothing but echo whatever text it receives. To do that, I'll first run ifconfig eth0 to show our container's IP address, which is here. Then I'll run nc -l -p 80 to start the server. We won't see anything after we run this because it's waiting for someone or something to send input to it. In container-b, I'll connect to container-a's server with Telnet. Telnet is a program that allows you to talk to servers behind TCP ports as if they were terminals. We'll need to install it first. To do…
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
-
-
-
-
-
-
-
-
-
(Locked)
Introduction to container networking2m 23s
-
(Locked)
Creating Docker networks with bridge-mode networking14m 5s
-
(Locked)
Exposing container ports between containers11m 39s
-
(Locked)
Sharing a host's network with host mode networking5m 49s
-
(Locked)
Disabling networking with the none driver2m 16s
-
(Locked)
Advanced network drivers and network plugins10m 25s
-
(Locked)
-
-
-
-