Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does docker view the container port mapping relationship

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "docker how to view container port mapping relationship", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "docker how to view container port mapping relationship" bar!

Method 1.

1. Open the xshell tool and click the create connection button

2. Enter the server ip address, fill in the user name, enter the password, and log in to the server

3. Use the docker ps command to view the container list and the command format

Docker container port CONTAINER [PRIVATE_ PORT[ / PROTO]]

Method 2.

Iptables-t nat-nL-- line-number

Add port mapping to view container static ip

Docker inspect `container_ name` | grep IPAddress

Add a port to map port 8000 of the container to port 8001 of the docker host

Iptables-t nat-A DOCKER-p tcp-- dport 8001-j DNAT-- to-destination 172.17.0.1

Check the addition status

Iptables-nL

Thank you for your reading. The above is the content of "how to check the container port mapping relationship of docker". After the study of this article, I believe you have a deeper understanding of how to view the container port mapping relationship of docker, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report