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 to View Docker Container Information

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

As you can see from the figure above, hostname is located in the node Config.Hostname, so you can get hostname by executing the command docker inspect-f {{.Config.Hostname}} tomcat001, as shown below:

Root@maven:~# docker inspect-f {{.Config.Hostname}} tomcat00198d119ed4c73

Ip address: execute the command docker inspect-f {{.NetworkSettings.IPAddress}} tomcat001 to get the ip address:

Root@maven:~# docker inspect-f {{.NetworkSettings.IPAddress}} tomcat001172.17.0.5

Environment variables: you can see from the complete inspect information that the content of the environment variable Config.Env is a json array, so in addition to using docker inspect-f {{.Config.Env}} tomcat001 to get all the environment variable information, you can also use the docker inspect-f'{{index .Config.Env 1}} 'tomcat001 command to get a record in the array, as follows:

Root@maven:~# docker inspect-f'{{index .Config.Env 1}} 'tomcat001LANG=C.UTF-8root@maven:~# docker inspect-f' {{index .Config.Env 2}} 'tomcat001 JAVA_HOME=/docker-java-home/jre has finished the introduction of this article "how to View Docker Container Information". If you want to master the knowledge points of this article, you still need to practice and use it. If you want to know more about related articles, welcome to follow the industry information channel.

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

Development

Wechat

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

12
Report