docker启动但没显示监听端口

root@Xshell:~# netstat -lpnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      202/sshd: /usr/sbin 
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      3005/systemd-resolv 
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      142274/sshd: root@p 
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN      177698/sshd: root@p 
tcp6       0      0 :::22                   :::*                    LISTEN      202/sshd: /usr/sbin 
tcp6       0      0 ::1:6010                :::*                    LISTEN      142274/sshd: root@p 
tcp6       0      0 ::1:6011                :::*                    LISTEN      177698/sshd: root@p 
root@Xshell:~# docker logs nifty_spence | tail -1
boot success!
root@Xshell:~# docker exec -it nifty_spence ob-mysql sys
login as root@sys
Command is: obclient -h127.1 -uroot@sys -A -Doceanbase -P2881 
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 3221569083
Server version: OceanBase_CE 4.2.2.0 (r100010012024022719-c984fe7cb7a4cef85a40323a0d073f0c9b7b8235) (Built Feb 27 2024 19:20:54)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

obclient [oceanbase]> 

能正常连接就应该没问题吧

可是很奇怪啊这个端口都没监听为什么能连接呢 :thinking:

监听在 docker 里。

docker exec -it nifty_spence bash
netstat -ntlp

链接使用docker命令,查看监听的时候也应该使用docker 命令