我对 linux 和 docker 还很陌生,所以为这篇文章道歉!
我有一个带有 Ubuntu 19.01 持久数据存储的可启动 USB。我使用官方 docker 安装指南中概述的步骤安装了 docker。我在安装过程中遇到的问题与未安装推荐的软件包有关:
Recommended packages:
aufs-tools cgroupfs-mount | cgroup-lite pigz
我尝试手动安装它们,但是收到以下消息:
sudo apt-get install aufs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package aufs-tools is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'aufs-tools' has no installation candidate
在任何情况下,这些不存在的软件包都不会导致安装失败。此后我运行 hello world 示例并看到以下错误:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:8e3114318a995a1ee497790535e7b88365222a21771ae7e53687ad76563e8e76
Status: Downloaded newer image for hello-world:latest
docker: Error response from daemon: error creating aufs mount to /var/lib/docker/aufs/mnt/db076c46f5f437911f80b48a2a53b8be05759964c059ad2f6a1389c0de377627-init: mount target=/var/lib/docker/aufs/mnt/db076c46f5f437911f80b48a2a53b8be05759964c059ad2f6a1389c0de377627-init data=br:/var/lib/docker/aufs/diff/db076c46f5f437911f80b48a2a53b8be05759964c059ad2f6a1389c0de377627-init=rw:/var/lib/docker/aufs/diff/3292099914e3c5804fbc573e521b32204a3b0cfef49aa3988677539bbf490624=ro+wh,dio,xino=/dev/shm/aufs.xino: invalid argument.
See 'docker run --help'.
当我运行时docker info
,我得到以下输出(截断):
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: overlayfs
Dirs: 2
Dirperm1 Supported: false
根据上面的输出可以说我的内核支持aufs吗?我试图通过运行来确认这一点grep aufs /proc/filesystems
并得到以下信息:
nodev aufs
当我df -Th /var/lib/docker
在我的根目录上运行时,我得到:
Filesystem Type Size Used Avail Use% Mounted on
/cow overlay 227G 4.7G 211G 3% /
根据我上面概述的所有内容,我不知道为什么会看到Error response from daemon: error creating aufs mount
错误?
我只能通过像这样附加--storage-driver=devicemapper
到/lib/systemd/system/docker.service
文件来让 docker 工作:
ExecStart=/usr/bin/dockerd --storage-driver=devicemapper -H fd://