Difficulty: beginner
Estimated Time: 10 minutes

In this scenario we'll learn about internals of container networking. We'll learn about various type of drivers available in container networking.

In this scenario we learned about container networking drivers like Bridge, Null, Host and Container driver.

Networking Fundamentals

Step 1 of 7

Step 1

Running a basic web server

Run a container if nginx image. docker run -d -P --name myweb nginx

You can find ports exposed by container in docker ps. Check PORTS column.

Also you can see web running in container using curl localhost:$(docker inspect myweb -f '{{(index (index .NetworkSettings.Ports "80/tcp") 0).HostPort}}')

Alternatively you can use docker port myweb 80 to get the exposed ports.

Port can be manually exposed using -p flag. docker run -d -p 8080:80 --name myweb1 nginx

Above command will start a container from image nginx with internal port 80 exposed to external port 8080.