不支持 Ubuntu 中的 Docker 将文件系统切换到覆盖?

Posted

技术标签:

【中文标题】不支持 Ubuntu 中的 Docker 将文件系统切换到覆盖?【英文标题】:Docker in Ubuntu switching filesystem to overlay is not supported? 【发布时间】:2017-06-15 01:24:14 【问题描述】:

我在 Mac 上以 root 用户身份登录的 Ubuntu 和 Ubuntu 的 vagrant 虚拟框中运行 docker,我试图从 devicemapper 切换到 overlay,但我收到一条错误消息:

root@vagrant-ubuntu-trusty-64:/# service docker stop
docker stop/waiting
root@vagrant-ubuntu-trusty-64:/# rm -rf /var/lib/docker
root@vagrant-ubuntu-trusty-64:/# docker daemon -s overlay
Command "daemon" is deprecated, and will be removed in Docker 1.16. Please run `dockerd` directly.
INFO[0000] libcontainerd: new containerd process, pid: 6788
WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=4096
ERRO[0001] 'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.
Error starting daemon: error initializing graphdriver: driver not supported
root@vagrant-ubuntu-trusty-64:/#

我尝试了以下说明:

http://www.projectatomic.io/blog/2015/06/notes-on-fedora-centos-and-docker-storage-drivers/ Unable to start Docker Service in Ubuntu 16.04

但它们都不适合我。

当我尝试遵循以下文档时:

https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/

我在第 2 步卡住了,因为 grep 没有从 lsmod 返回任何“覆盖”:

root@vagrant-ubuntu-trusty-64:/# uname -r
3.13.0-107-generic
root@vagrant-ubuntu-trusty-64:/# lsmod | grep overlay
root@vagrant-ubuntu-trusty-64:/#


root@vagrant-ubuntu-trusty-64:/# dockerd --storage-driver=overlay
INFO[0000] libcontainerd: new containerd process, pid: 6816
WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=4096
ERRO[0001] 'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.
Error starting daemon: error initializing graphdriver: driver not supported
root@vagrant-ubuntu-trusty-64:/#

我该如何解决这个问题?

【问题讨论】:

【参考方案1】:

来自https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#configure-docker-with-the-overlayoverlay2-storage-driver

要将 Docker 配置为使用覆盖存储驱动程序,您的 Docker 主机必须运行 3.18 版 Linux 内核(最好是更新版本)并加载覆盖内核模块。对于 overlay2 驱动程序,您的内核版本必须为 4.0 或更高版本。

您正在运行内核 3.13,所以没有骰子。我的建议是备份您的虚拟机并尝试将内核升级到更新版本(我有 14.04 并且有更新的内核可用,尽管尚未测试它们的工作情况)或将您的 Ubuntu VM 升级到 16.04

【讨论】:

以上是关于不支持 Ubuntu 中的 Docker 将文件系统切换到覆盖?的主要内容,如果未能解决你的问题,请参考以下文章

将Linux的系统制作成Docker镜像

docker设置容器中的Ubuntu系统的语言

ubuntu Docker 中文支持,及中文乱码问题

ubuntu14.04环境下利用docker搭建solrCloud集群

如何将自己当前调试好的Ubuntu系统制作成iso格式镜像文件

Ubuntu 18.04安装Docker CE + NVIDIA-Docker