我已按照以下说明从存储库安装了docker-ce:
https://docs.docker.com/install/linux/docker-ce/centos/
尝试启动docker时收到错误:
docker.service的作业失败,因为控制进程退出并显示错误代码。请参阅" systemctl status docker.service"和" journalctl -xe"详情。
journalctl有以下内容:
...
dockerd[3647]: time="2018-02-05T14:47:05-08:00" level=info msg="containerd successfully booted in 0.002946s" module=containerd
dockerd[3647]: time="2018-02-05T14:47:05.456552594-08:00" level=error msg="There are no more loopback devices available."
dockerd[3647]: time="2018-02-05T14:47:05.456585240-08:00" level=error msg="[graphdriver] prior storage driver devicemapper failed: loopback attach failed"
dockerd[3647]: Error starting daemon: error initializing graphdriver: loopback attach failed
systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start Docker Application Container Engine.
我见过有关使用环回设备以外的其他内容的文章,但据我所知,这些内容表明要进行优化 - 并不意味着初始启动应该失败。
CentOS Linux版本7.4.1708(核心)
答案 0 :(得分:0)
在同一Debian XEN 4.8主机上的Debian 9 VM和Debian 8 VM中都存在相同的问题。
回送似乎不存在:
# losetup -f
losetup: cannot find an unused loop device: No such device
您可以使用以下内容创建
#!/bin/bash
ensure_loop(){
num="$1"
dev="/dev/loop$num"
if test -b "$dev"; then
echo "$dev is a usable loop device."
return 0
fi
echo "Attempting to create $dev for docker ..."
if ! mknod -m660 $dev b 7 $num; then
echo "Failed to create $dev!" 1>&2
return 3
fi
return 0
}
ensure_loop 0
ensure_loop 0
但这只是找到正确解决方案的提示,它并不能完全解决问题,因为/dev/loop0
存在,所以出现错误:
Error opening loopback device: open /dev/loop0: no such device or address
[graphdriver] prior storage driver devicemapper failed: loopback attach failed
答案 1 :(得分:0)
如果您在Xen上的VM中运行Linux,则需要安装内核并使用pygrub(请参阅https://wiki.debian.org/PyGrub)并更新到docker版本19.03.0。
mkdir /boot/grub
apt-get install -y linux-image-amd64
cat > /boot/grub/menu.lst << EOF
default 0
timeout 2
title Debian GNU/Linux
root (hd0,0)
kernel /vmlinuz root=/dev/xvda2 ro
initrd /initrd.img
title Debian GNU/Linux (recovery mode)
root (hd0,0)
kernel /vmlinuz root=/dev/xvda2 ro single
initrd /initrd.img
EOF
xen destroy vm01
例如,对于DOM0中的VM /etc/xen/vm01.cfg
(注释出前两行并添加后三行):
#kernel = '/boot/vmlinuz-4.9.0-9-amd64'
#ramdisk = '/boot/initrd.img-4.9.0-9-amd64'
extra = 'elevator=noop'
bootloader = '/usr/lib/xen-4.8/bin/pygrub'
bootloader_args = [ '--kernel=/vmlinuz', '--ramdisk=/initrd.img', ]
xen create /etc/xen/vm01.cfg