如何获得docker ip , (安装 过程, apt update, apt instal net-tools ... )
docker ip 的查看
使用sudo docker-compose up
出现了报错
WARNING: Found orphan containers (test_rails_crud_db_1, test_rails_crud_web_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. Starting postgres14.3 ... Starting postgres14.3 ... errorERROR: for postgres14.3 Cannot start service postgres14.3: driver failed programming external connectivity on endpoint postgres14.3 (1eb701338d09b3f05f36238ba1092b4cdd055aed72b9bae2bcab6c3200569535): Error starting userland proxy: listen tcp4 0.0.0.0:5432: bind: address already in useERROR: for postgres14.3 Cannot start service postgres14.3: driver failed programming external connectivity on endpoint postgres14.3 (1eb701338d09b3f05f36238ba1092b4cdd055aed72b9bae2bcab6c3200569535): Error starting userland proxy: listen tcp4 0.0.0.0:5432: bind: address already in use ERROR: Encountered errors while bringing up the project.
端口被占用,那么进行查看 lsof -i:5432
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME postgres 4373 linlin 3u IPv4 58407 0t0 TCP *:postgresql (LISTEN) postgres 4373 linlin 4u IPv6 58408 0t0 TCP *:postgresql (LISTEN) python3 6978 linlin 12u IPv4 83141 0t0 TCP localhost:54620->localhost:postgresql (ESTABLISHED) python3 6978 linlin 13u IPv4 83142 0t0 TCP localhost:54622->localhost:postgresql (ESTABLISHED) python3 6978 linlin 14u IPv4 86077 0t0 TCP localhost:54624->localhost:postgresql (ESTABLISHED) python3 6978 linlin 15u IPv4 82466 0t0 TCP localhost:54626->localhost:postgresql (ESTABLISHED) python3 6978 linlin 16u IPv4 796868 0t0 TCP localhost:54656->localhost:postgresql (ESTABLISHED) python3 6978 linlin 17u IPv4 791976 0t0 TCP localhost:54658->localhost:postgresql (ESTABLISHED) python3 6978 linlin 18u IPv4 786298 0t0 TCP localhost:54644->localhost:postgresql (ESTABLISHED) python3 6978 linlin 19u IPv4 793328 0t0 TCP localhost:54660->localhost:postgresql (ESTABLISHED) python3 6978 linlin 20u IPv4 786300 0t0 TCP localhost:54650->localhost:postgresql (ESTABLISHED) python3 6978 linlin 21u IPv4 793099 0t0 TCP localhost:54654->localhost:postgresql (ESTABLISHED) python3 6978 linlin 22u IPv4 1121214 0t0 TCP localhost:54666->localhost:postgresql (ESTABLISHED) python3 6978 linlin 23u IPv4 1143824 0t0 TCP localhost:54668->localhost:postgresql (ESTABLISHED) python3 6978 linlin 24u IPv4 1142614 0t0 TCP localhost:54670->localhost:postgresql (ESTABLISHED)
查看cd /proc/4373
/proc/4373$ ll
total 0 dr-xr-xr-x 9 linlin linlin 0 5月 31 13:41 ./ dr-xr-xr-x 459 root root 0 5月 30 08:12 ../ -r--r--r-- 1 linlin linlin 0 6月 2 09:53 arch_status dr-xr-xr-x 2 linlin linlin 0 6月 2 09:53 attr/ -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 autogroup -r-------- 1 linlin linlin 0 6月 2 09:53 auxv -r--r--r-- 1 linlin linlin 0 6月 2 09:53 cgroup --w------- 1 linlin linlin 0 6月 2 09:53 clear_refs -r--r--r-- 1 linlin linlin 0 5月 31 13:41 cmdline -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 comm -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 coredump_filter -r--r--r-- 1 linlin linlin 0 6月 2 09:53 cpu_resctrl_groups -r--r--r-- 1 linlin linlin 0 6月 2 09:53 cpuset lrwxrwxrwx 1 linlin linlin 0 6月 2 09:51 cwd -> /home/linlin/.asdf/installs/postgres/9.5.25/data/ -r-------- 1 linlin linlin 0 6月 2 09:53 environ lrwxrwxrwx 1 linlin linlin 0 5月 31 13:41 exe -> /home/linlin/.asdf/installs/postgres/9.5.25/bin/postgres* dr-x------ 2 linlin linlin 0 6月 2 09:47 fd/ dr-x------ 2 linlin linlin 0 6月 2 09:47 fdinfo/ -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 gid_map -r-------- 1 linlin linlin 0 6月 2 09:53 io -r--r--r-- 1 linlin linlin 0 6月 2 09:53 limits -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 loginuid dr-x------ 2 linlin linlin 0 6月 2 09:53 map_files/ -r--r--r-- 1 linlin linlin 0 6月 2 09:51 maps -rw------- 1 linlin linlin 0 6月 2 09:53 mem -r--r--r-- 1 linlin linlin 0 6月 2 09:53 mountinfo -r--r--r-- 1 linlin linlin 0 6月 2 09:53 mounts -r-------- 1 linlin linlin 0 6月 2 09:53 mountstats dr-xr-xr-x 59 linlin linlin 0 6月 2 09:53 net/ dr-x--x--x 2 linlin linlin 0 6月 2 09:53 ns/ -r--r--r-- 1 linlin linlin 0 6月 2 09:53 numa_maps -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 oom_adj -r--r--r-- 1 linlin linlin 0 6月 2 09:53 oom_score -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 oom_score_adj -r-------- 1 linlin linlin 0 6月 2 09:53 pagemap -r-------- 1 linlin linlin 0 6月 2 09:53 patch_state -r-------- 1 linlin linlin 0 6月 2 09:53 personality -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 projid_map lrwxrwxrwx 1 linlin linlin 0 6月 2 09:51 root -> // -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 sched -r--r--r-- 1 linlin linlin 0 6月 2 09:53 schedstat -r--r--r-- 1 linlin linlin 0 6月 2 09:53 sessionid -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 setgroups -r--r--r-- 1 linlin linlin 0 6月 2 09:53 smaps -r--r--r-- 1 linlin linlin 0 6月 2 09:53 smaps_rollup -r-------- 1 linlin linlin 0 6月 2 09:53 stack -r--r--r-- 1 linlin linlin 0 5月 31 13:41 stat -r--r--r-- 1 linlin linlin 0 6月 2 09:53 statm -r--r--r-- 1 linlin linlin 0 6月 2 09:53 status -r-------- 1 linlin linlin 0 6月 2 09:53 syscall dr-xr-xr-x 3 linlin linlin 0 6月 2 09:53 task/ -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 timens_offsets -r--r--r-- 1 linlin linlin 0 6月 2 09:53 timers -rw-rw-rw- 1 linlin linlin 0 6月 2 09:53 timerslack_ns -rw-r--r-- 1 linlin linlin 0 6月 2 09:53 uid_map -r--r--r-- 1 linlin linlin 0 6月 2 09:53 wchan
/proc/4373$ ifconfig -a
br-1cdb9e69418c: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255ether 02:42:3a:2b:82:df txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0br-5c3dad90f52b: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500inet 172.21.0.1 netmask 255.255.0.0 broadcast 172.21.255.255ether 02:42:9a:5b:d2:0c txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0br-5d40ced148b5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 172.23.0.1 netmask 255.255.0.0 broadcast 172.23.255.255inet6 fe80::42:8fff:fe76:38d prefixlen 64 scopeid 0x20<link>ether 02:42:8f:76:03:8d txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 54 bytes 6848 (6.8 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0br-75ab2acb8190: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500inet 172.22.0.1 netmask 255.255.0.0 broadcast 172.22.255.255ether 02:42:c1:43:1c:54 txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0br-8699ceffea25: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255ether 02:42:82:a9:06:f5 txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0br-c200ea24cd1a: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500inet 172.20.0.1 netmask 255.255.0.0 broadcast 172.20.255.255ether 02:42:d3:ec:76:88 txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255inet6 fe80::42:5eff:fe1d:4f6b prefixlen 64 scopeid 0x20<link>ether 02:42:5e:1d:4f:6b txqueuelen 0 (Ethernet)RX packets 73301 bytes 4399446 (4.3 MB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 112201 bytes 187994554 (187.9 MB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0inet6 ::1 prefixlen 128 scopeid 0x10<host>loop txqueuelen 1000 (Local Loopback)RX packets 2330194 bytes 1254030331 (1.2 GB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 2330194 bytes 1254030331 (1.2 GB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0vetha6d10df: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet6 fe80::d851:3fff:fe73:f217 prefixlen 64 scopeid 0x20<link>ether da:51:3f:73:f2:17 txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 31 bytes 4477 (4.4 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0vethc22af7c: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet6 fe80::24f7:d8ff:fe2f:dff8 prefixlen 64 scopeid 0x20<link>ether 26:f7:d8:2f:df:f8 txqueuelen 0 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 31 bytes 4477 (4.4 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255inet6 fe80::d150:4db9:6c63:6bd1 prefixlen 64 scopeid 0x20<link>ether 14:13:33:af:aa:ed txqueuelen 1000 (Ethernet)RX packets 13862378 bytes 16158002300 (16.1 GB)RX errors 0 dropped 623718 overruns 0 frame 0TX packets 7227500 bytes 1096232937 (1.0 GB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
在docker进行查看 sudo docker run -it ubuntu bash
root@11f55a91272d:/# ifconfig -a
此时会出现报错,bash: ifconfig: command not found
因为每次进入docker都需要重新进行配置安装,docker是一个简单的容器
使用命令进行更新,root@11f55a91272d:/# apt update
然后还需要安装config 进行命令的查询 root@11f55a91272d:/# apt install net-tools
安装结束就可以进行查询了root@11f55a91272d:/# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet)RX packets 8803 bytes 22039340 (22.0 MB)RX errors 0 dropped 0 overruns 0 frame 0TX packets 6971 bytes 500909 (500.9 KB)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0loop txqueuelen 1000 (Local Loopback)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0root@11f55a91272d:/# su postgres su: user postgres does not exist or the user entry does not contain all the required fields root@11f55a91272d:/# psql bash: psql: command not found root@11f55a91272d:/# ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 02:13 pts/0 00:00:00 bash root 240 1 0 02:17 pts/0 00:00:00 ps -ef
如何获得docker ip , (安装 过程, apt update, apt instal net-tools ... )相关推荐
- 安装 VS 2015 Update 2 + Windows SDK Tools 1.3.1 + Windows SDK 10586.212 后提示找不到 10586.0 SDK 问题的解决方法...
将 Visual Studio 2015 升级到 Update 2,并安装 Windows SDK Tools 1.3.1 和 Windows SDK 10586.212 后,有可能造成原本已安装的 ...
- WSL2 + Docker + xfce4安装及使用
WSL2 + Docker + xfce4安装及使用 WSL官方指南:适用于 Linux 的 Windows 子系统安装指南 (Windows 10) 文档比较详细,而且会持续更新,欢迎大家指错. 文 ...
- 机器从零到 K8S 集群 Worker 节点的安装过程
最近基于 Hyper-V 虚拟机搭了一个单节点的 K8S,过程没有记录下来 本次实践从零开始搭建一个 K8S Slave 节点 机器从零到 K8S 集群 Slave 节点的安装过程 实践环境 安装 L ...
- vmware虚拟机redhat7.2下docker容器安装hadoop
2019独角兽企业重金招聘Python工程师标准>>> 系统准备: 系统安装及配置 [略]详见:http://www.osyunwei.com/archives/7702.ht ...
- vmware搭建ubuntu虚拟机(包含安装搜狗输入法和apt,dpkg的使用教程)
我曾经搭建过Ubuntu的虚拟机,但是好久不用了,有些生疏,故写此笔记来记录全过程. 一.下载iso镜像文件 从Ubuntu官网下载镜像文件,一般开发用Desktop版,服务器用Server版. 文件 ...
- linux安装过程中遇到了“kernel panic : no working init found“的解决措施
如题,遇到此类问题,首先看log 这说明内核部分启动顺利,值得庆祝,但是问题出在了制作的根文件目录里,缺乏init来启动rootfs. 简而言之就是如下解决措施 chroot rootfs apt u ...
- apt update、apt upgrade 和 apt dist-upgrade 的区别
1.root@kali:~# apt update apt update 的作用是从/etc/apt/sources.list文件中定义的源中获取的最新的软件包列表.即运行 apt update 并没 ...
- Ubuntu 中apt update和upgrade 的区别
运行gazebo出问题,往往就需要sudo apt upgrade来解决 摘自:https://blog.csdn.net/zhjulia123/article/details/83479515 简要 ...
- Ubuntu(Linux)上安装ROS缓慢,解决方法:添加ros的国内镜像源,以及ROS安装过程使用rosdep update出现错误:‘The read operation timed out‘
文章目录: 1 解决Unbuntu上安装ROS特别慢问题 1.1 Ubunut 更换ROS的镜像源为国内的镜像源 1.2 如果是Mint19.3系统,请参考如下添加ros镜像源 2 ROS安装过程su ...
最新文章
- 权限控制的两种主要方式详述
- php 值不进行解码,无法解码PHP中的JSON值
- 「应用管理与交付」为什么会成为云原生新的价值聚焦点?
- poj-2828 Buy Tickets ***
- js里的面向对象分析-(创建实例化对象)
- python enumeration_如何在python中将int转换为Enum?
- 今天跟某个投了社区团购的资本合伙人聊,发现对于社区团购的认知,还是太肤浅
- python 字典处理_python之高效处理字典、序列的一些语法
- jdk13不能显示中文_JDK 13都发布了!你还在用JDK7吗?
- paip.提升用户体验---文件查找
- Java移位运算符原来这么简单
- 达梦数据库的简单使用
- 阿里云域名购买和域名解析教程
- 最新论文笔记(+12):Searching an Encrypted Cloud Meets Blockchain: A decentralized, Reliable and Fair Realiz
- 不使用插件,小程序也能完整的渲染富文本(视频展现,图片自适应)
- 注意!出现这十种症状,说明你不适合做程序员
- 微信小程序如何封装自己的组件?
- 2023年浙江交安安全员考试题库及答案
- LWN:万维网之外的选择!
- 变异系数(测算数据离散程度相对指标)