Skip to content

Latest commit

 

History

History
60 lines (36 loc) · 1.41 KB

19_publish_network_interfaces.md

File metadata and controls

60 lines (36 loc) · 1.41 KB

Publishing Network Interfaces

Docker Documentation References:

docker run

Intent

The purpose of this kata is to familiarize yourself with the process of exposing a network port on a running Docker Container

Overview

In this exercise, we will run a simple NGINX image and publish its network interface.

Kata Steps

Command

docker run --detach --publish 8080:80 nginx:stable-alpine

Here, --detach causes the container to run as a daemon and --publish maps localhost port 8080 to the containers port 80

Output

thought:DockerKata rich$ docker run --detach --publish 8080:80 nginx:stable-alpine
91b256c402a1cb4ed6745c7621be6346689236387208284cf58df430e812e248

Test the running container

Command (in another terminal):

open http://localhost:8080

Or click here

NGINX Screen Shot

Stop the running container

Command

docker stop 91b256c402a1cb4ed6745c7621be6346689236387208284cf58df430e812e248

Output

thought:DockerKata rich$ docker stop 91b256c402a1cb4ed6745c7621be6346689236387208284cf58df430e812e248
91b256c402a1cb4ed6745c7621be6346689236387208284cf58df430e812e248

Previous | Index | Next