From the course: Learning Docker Compose
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Exposing ports - Docker Tutorial
From the course: Learning Docker Compose
Exposing ports
- [Instructor] The advantage of a containerization tool like Docker is that an entire application can be fully encapsulated inside of a single container. But by default, things outside of the container cannot access or communicate with anything running inside of the container. Containerized services usually need to communicate with each other or with the outside world, and developers typically want to access a containerized application via a local host. The way to allow this is by specifically exposing a port that maps from the host machine to the Docker container. There are over 65,000 TCP ports. Most services have a specific port that they'll operate on by default. Using standard Docker syntax without Compose, you would have to add port mappings when you run each container. It can be difficult to remember which ports should be exposed for each Dockerized service cannot expose the same port twice on the same host machine.…
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.