我在学习如何构建 Docker 镜像时,按照书上的案例构建镜像,提示kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1,于是去翻了 Google 资源,发现应该有人也在3.x的内核中遇到该问题
[root@server myubuntu]# docker build -t redis .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu
---> d355ed3537e9
Step 2 : RUN buildDeps="gcc make" && apt-get update && apt-get install -y $buildDeps && wget -O redis.tar.gz "http://download.redis.io/releases/redis-3.2.5.tar.gz" && mkdir -p /usr/src/redis && tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1 && make -C /usr/src/redis && make -C /usr/src/redis install && rm -rf /var/lib/apt/lists/* && rm redis.tar.gz && rm -r /usr/src/redis && apt-get purge -y --auto-remove $buildDeps
---> Running in 2ac65d9db8e4
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [39.9 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [370 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.8 kB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [173 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [2937 B]
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Message from syslogd@server at Jul 7 20:44:08 ...
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
Get:12 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Message from syslogd@server at Jul 7 20:44:18 ...
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
Message from syslogd@server at Jul 7 20:44:28 ...
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [204 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [728 kB]
我内核
[root@server ~]# uname -ar
Linux server 3.10.0-514.26.1.el7.x86_64 #1 SMP Thu Jun 29 16:05:25 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
docker 版本
[root@server ~]# docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-1.12.6-32.git88a4867.el7.centos.x86_64
Go version: go1.7.4
Git commit: 88a4867/1.12.6
Built: Mon Jul 3 16:02:02 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Package version: docker-1.12.6-32.git88a4867.el7.centos.x86_64
Go version: go1.7.4
Git commit: 88a4867/1.12.6
Built: Mon Jul 3 16:02:02 2017
OS/Arch: linux/amd64
解决办法
yum -y update
更新下系统就没有出错了