[root@VM_0_13_centos kubernetes-elasticsearch]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1421f7bbc523 goharbor/nginx-photon:v2.0.0 "nginx -g 'daemon of…" 6 days ago Up 6 days (healthy) 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp nginx e9ab5bf15849 goharbor/harbor-jobservice:v2.0.0 "/harbor/entrypoint.…" 6 days ago Up 6 days (healthy) harbor-jobservice d04f14741f3d goharbor/harbor-core:v2.0.0 "/harbor/entrypoint.…" 6 days ago Up 6 days (healthy) harbor-core c31d291b2425 goharbor/redis-photon:v2.0.0 "redis-server /etc/r…" 6 days ago Up 6 days (healthy) 6379/tcp redis 13f1de98a114 goharbor/registry-photon:v2.0.0 "/home/harbor/entryp…" 6 days ago Up 6 days (healthy) 5000/tcp registry 9e154ff22c54 goharbor/harbor-registryctl:v2.0.0 "/home/harbor/start.…" 6 days ago Up 6 days (healthy) registryctl 051736f00111 goharbor/harbor-db:v2.0.0 "/docker-entrypoint.…" 6 days ago Up 6 days (healthy) 5432/tcp harbor-db b10b982a225a goharbor/harbor-portal:v2.0.0 "nginx -g 'daemon of…" 6 days ago Up 6 days (healthy) 8080/tcp harbor-portal 3a0d7ec954c5 goharbor/harbor-log:v2.0.0 "/bin/sh -c /usr/loc…" 6 days ago Up 6 days (healthy) 127.0.0.1:1514->10514/tcp harbor-log [root@VM_0_13_centos kubernetes-elasticsearch]# nsenter --target 6128 [root@VM_0_13_centos kubernetes-elasticsearch]# docker inspect -f {{.State.Pid}} 1421f7bbc523 6128 [root@VM_0_13_centos kubernetes-elasticsearch]# nsenter -n --target 6128
进入之后可以执行对应的ip address,ping,telnet,ss,tcpdump命令等
1 2 3 4 5 6 7 8 9 10 11 12
[root@VM_0_13_centos kubernetes-elasticsearch]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN groupdefault qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 31887: eth0@if31888: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP groupdefault link/ether 02:42:ac:1f:00:0a brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet172.31.0.10/16 brd 172.31.255.255 scope global eth0 valid_lft forever preferred_lft forever [root@VM_0_13_centos kubernetes-elasticsearch]# tcpdump -i eth0 tcp tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes