Docker – 07- Container Networking,IPAddress,Port


Docker Container Networking,IPAddress,Port

Firstly we will create the web server

docker run -d –publish-all jpetazzo/web

Ports   -> Port Mapping

:32768-> Host Port Number

:8000-> Containers Port Number

curl localhost:32768

Get the Host Port number by container number

docker port <container_id> 8000

You can assign manually port

docker run -d -p 88:8000 jpetazzo/web

You can get the container  private ip address

docker inspect –format ‘{{.NetworkSettings.IPAdress}}’ <container_id>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s