Configure port mapping for windows container

Configure port mapping for windows container

Configure port mapping for windows container

In this blog, we will show you configure port mapping for windows container using docker commands.

 

INTRODUCTION

We need to configure the port mapping to access the web application inside the container. Need to specify the source and destination port while creating the containers.

 

PORT MAPPING

  • To configure the port mapping while creating the container, use the below command.

 

SYNTAX: docker run -it -p <source port of windows container host>:<destination port in the container> <container image>

Example : docker run -it -p 80:80 azcontainerr/web

 

docker – Base command for docker CLI

run – To start a new container

-it – Run in interactive mode

-p – Specify the port mapping

80 (left hand side) source port– Map the windows container host port.

80(right hand side) Destination port – Map the container port.

azcontainerr/web – Container Image.

 

Configure port mapping for windows container

 

  • Once the container is up and running, type ipconfig to view the IP details.

Configure port mapping for windows container

 

  • We got an IP as 10.0.0.190. Now the NAT translation has been set from the host IP to container IP.

 

  • Press CTRL+PQ to disconnect from the container.

Configure port mapping for windows container

 

  • Type docker ps command.

Configure port mapping for windows container

 

  • You can see our port mapping has been shown above.

 

  • Now we use the windows container host IP (192.168.232.80) to access the container web application.

 

  • We cannot access the web application using container host IP from container host itself. This limitation is how windows NAT works. We hope microsoft will fix in the future version. If we try to browse the container host IP through web browser, will receive the below output.

Configure port mapping for windows container

 

  • You can able to access the container application using container IP (10.0.0.190).

Configure port mapping for windows container

 

  • Able to access the windows container host IP from the client machine.

Configure port mapping for windows container

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn to configure port mapping for windows container.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage
ZFS Pool and Dataset Usage

I am back with another blog to provide the useful script to the Freebsd users to determine the zpool and it’s datasets usage report. This

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support