Docker 为容器添加ip

#查看网卡 找打与外部交互的网卡
ifconfig

#添加IP到eth0网卡上
ifconfig eth0:0 172.16.26.220 netmask 255.255.255.0 up

#查看网卡
ifconfig

#运行容器
docker run -i -t -d -p 172.16.26.220:8090:8080 7c824a2bc3d6 /bin/bash

猜你喜欢

转载自samson870830.iteye.com/blog/2373079