[Linux]

因为阿里云的CentOS 6.5版本默认内核kernel版本是2.6的,比较低。安装docker的后,运行不了。

步骤:

1、使用命令更新:

yum update

2、安装Docker。这里忽略500字。。。。

3、使用命令查看IP:

ifconfig

将看到有类似的结果:

eth0      Link encap:Ethernet  HWaddr 00:16:3E:00:6B:5D
          inet addr:10.169.127.193  Bcast:10.169.127.255  Mask:255.255.248.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:103408201 errors:0 dropped:0 overruns:0 frame:0
          TX packets:426317 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4734752352 (4.4 GiB)  TX bytes:38914346 (37.1 MiB)
          Interrupt:164

4、使用命令运行Docker:

docker -bip=10.169.127.193/24 -d

5、运行完后,可以再使用命令 ifconfig看IP配置:

docker0   Link encap:Ethernet  HWaddr 86:AF:F8:0A:6F:FF
          inet addr:10.169.127.193  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

这里多了一个docker0的桥接网卡。

就这样。

原文地址:https://www.cnblogs.com/HD/p/4864295.html