Docker building fails randomly with Error mounting

帅比萌擦擦* 提交于 2020-01-05 02:24:09

问题


Every time I try building with docker or fig an image (doesn't matter which one), I randomly will get

Cannot start container <containerId>: Error getting container <containerId> from driver devicemapper: Error mounting '/dev/mapper/docker-8:1-262151-<containerId>' on '/var/lib/docker/devicemapper/mnt/<containerId>': no such file or directory

Weird thing is, if I re-run it, it usually won't have the same error.

Note that I am running docker inside vagrant (ubuntu-trusty-64)


回答1:


I have seen this many times in docker-1.4.1, especially if you're using a base image built with a previous version of docker. You can try to rebuild your base image with docker-1.4.1, but why I ended up doing with just going back to docker-1.3.3 for now.




回答2:


Switching to aufs storage seemed to resolve it.

I used a base image box from phusion which seems to optimize for docker.




回答3:


This is known bug occuring with devicemapper driver only.

Here is the reference of the bug: https://github.com/docker/docker/issues/4036

Solution is to switch either to aufs or overlayfs drivers.



来源:https://stackoverflow.com/questions/28072532/docker-building-fails-randomly-with-error-mounting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!