一、PIP 踩坑
Ubuntu 中pip 10 更新后常常出现执行错误,通过下面方式可修复并升级到最新版本:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
二、Docker 踩坑 -- Docker常见问题及解决方法
1.kernel:unregister_netdevice:...
kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1
这是个从 2014 年就出现了的老 BUG,不管是 RHEL、CentOS、Ubuntu 还是 Debian 都会碰到。这实际上是 Linux 内核的一个 BUG,目前仍未彻底解决,尽量升级最新的 Linux 内核吧。
2. Failed to get D-Bus connection:...
2. Failed to get D-Bus connection:...
Failed to get D-Bus connection: Operation not permitted
在 Docker 中执行 systemctl 命令时触发这个错误,常见于使用 Systemd 的 Linux 发行版,比如 CentOS 7 全系列。
# systemctl start vsftpd
Failed to get D-Bus connection: Operation not permitted
2.1 解决方案
2.1 解决方案
方案1. 官方解决方案
方案1. 官方解决方案
官方解决方案 是创建一个中间镜像,然后在这个镜像基础上构建你的镜像。
方案2. 避免使用 systemctl 命令
方案2. 避免使用 systemctl 命令
比如直接通过
/usr/sbin/sshd & (
& 表示后台运行程序)来执行命令。
方案3. 开启特权模式
方案3. 开启特权模式