vlead / AWS-Docker

This repository holds all the information after the exploration of AWS-Docker as a project in 2016-Summer-internship program
Other
0 stars 1 forks source link

Networking and bridging in docker containers #7

Open ashay-maheshwari opened 8 years ago

ashay-maheshwari commented 8 years ago

Docker containers are connected with a automatically created bridge called docker0. All containers are internally connected with docker0 bridge as in private network.

We need to expose those containers, so that they can be accessed from other machines in the network. This need exploration of networking and bridging option in docker.

sivashankerN commented 8 years ago

We can create our own bridge and we can use that bridge for our containers. I created the bridge using docker network create -d bridge --subnet x.x.x.x/x --gateway x.x.x.x -o <options> <bridge-name> after that we can create containers using this bridge as follows docker run/create -itd --net <bridge-name> --name <name-of-the-container> busybox