提取 Java 8 映像时出现 Docker 错误 - “无法注册层”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35325103/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Docker error when pulling Java 8 image - "failed to register layer"
提问by Chris Cizek
I am trying to pull the latest official Java docker image (java:8), but I keep getting a failed to register layer
error. The Java 7 and 9 docker images download successfully. I am running OS X El Capitan version 10.11.1.
我正在尝试提取最新的官方 Java docker 映像 (java:8),但我一直收到failed to register layer
错误消息。Java 7 和 9 docker 镜像下载成功。我正在运行 OS X El Capitan 版本 10.11.1。
> docker -v
Docker version 1.10.0, build 590d5108
> docker-machine -v
docker-machine version 0.6.0, build e27fb87
> docker pull java:8
8: Pulling from library/java
03e1855d4f31: Extracting [==================================================>] 51.36 MB/51.36 MB
a3ed95caeb02: Download complete
9269ba3950bb: Download complete
6ecee6444751: Download complete
5b865d39f77d: Download complete
e7e5c0273866: Download complete
6a4effbc4451: Download complete
4b6cb08bb4bc: Download complete
7b07ad270e2c: Download complete
failed to register layer: rename /mnt/sda1/var/lib/docker/image/aufs/layerdb/tmp/layer-273420626 /mnt/sda1/var/lib/docker/image/aufs/layerdb/sha256/78dbfa5b7cbc2bd94ccbdba52e71be39b359ed7eac43972891b136334f5ce181: directory not empty
Has anyone run across a similar error and successfully resolved it? Thanks
有没有人遇到过类似的错误并成功解决了它?谢谢
回答by C-Shark
Sometimes docker messes up its workspace, probably that's the cause. You can try these:
有时 docker 会弄乱它的工作区,可能这就是原因。你可以试试这些:
- stop all (java) containers, remove them, delete the java image (or all images), then re-pull and run.
- if this doesn't help, then restart the docker engine too.
- if even this doesn't solve the problem, stop the docker engine, delete the docker working directory, then restart docker engine.
- 停止所有(java)容器,删除它们,删除java图像(或所有图像),然后重新拉动并运行。
- 如果这没有帮助,那么也重新启动 docker 引擎。
- 如果即使这样也不能解决问题,请停止 docker 引擎,删除 docker 工作目录,然后重新启动 docker 引擎。
In my experience, this solves all similar issues like OP.
根据我的经验,这解决了所有类似的问题,如 OP。