Mac上的Docker:设备上没有剩余空间

前端之家收集整理的这篇文章主要介绍了Mac上的Docker:设备上没有剩余空间前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试从安装Java 8的Ubuntu 14.04构建一个基本的Docker镜像.这是我到目前为止所拥有的:

  1. FROM ubuntu:14.04
  2. MAINTAINER Me Myself

当我运行docker build -t memyself / docker_sample时.我在安装Java时遇到以下错误

  1. myuser@mymachine:~/sandBox/workspace/docker_sample$docker build -t memyself/docker_sample .
  2. Sending build context to Docker daemon 127.1 MB
  3. Step 0 : FROM ubuntu:14.04
  4. ---> 91e54dfb1179
  5. Step 1 : MAINTAINER Me Myself

知道我哪里出错了?

更新:

添加了apt-get install -y software-properties-common行,现在我得到了大量的输出,其中一些是:

  1. 162816K ........ ........ ........ ........ ........ ........ 93% 3.92M 2s
  2. 165888K ........ ........ ........ ........ ........ ........ 95% 5.43M 1s
  3. 168960K ........ ........ ........ ........ ........ ........ 97% 6.35M 1s
  4. 172032K ........ ........ ........ ........ ........ ........ 98% 6.09M 0s
  5. 175104K ........ ........ ........ ..... 100% 5.27M=32s
  6. 2015-09-25 15:33:33 (5.43 MB/s) - 'jdk-8u60-linux-x64.tar.gz' saved [181238643/181238643]
  7. Download done.
  8. Removing outdated cached downloads...
  9. tar: jdk1.8.0_60/jre/lib/charsets.jar: Wrote only 3072 of 10240 bytes
  10. tar: jdk1.8.0_60/jre/lib/jce.jar: Cannot write: No space left on device
  11. tar: jdk1.8.0_60/jre/lib/amd64/libbci.so: Cannot write: No space left on device
  12. tar: jdk1.8.0_60/jre/lib/amd64/libjavafx_font_freetype.so: Cannot write: No space left on device
  13. tar: jdk1.8.0_60/jre/lib/amd64/libawt_headless.so: Cannot write: No space left on device
  14. tar: jdk1.8.0_60/jre/lib/amd64/libdt_socket.so: Cannot write: No space left on device
  15. tar: jdk1.8.0_60/jre/lib/amd64/libmlib_image.so: Cannot write: No space left on device
  16. ...Huge amount of output omitted for brevity...
  17. tar: jdk1.8.0_60/bin/jvisualvm: Cannot write: No space left on device
  18. tar: jdk1.8.0_60/bin/jcontrol: Cannot write: No space left on device
  19. tar: jdk1.8.0_60/release: Cannot write: No space left on device
  20. tar: Exiting with failure status due to prevIoUs errors
  21. cannot unpack jdk8
  22. Oracle JDK 8 is NOT installed.
  23. debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: No space left on device
  24. dpkg: error processing package oracle-java8-installer (--configure):
  25. subprocess installed post-installation script returned error exit status 1
  26. Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
  27. dpkg: unrecoverable fatal error,aborting:
  28. unable to flush /var/lib/dpkg/updates/tmp.i after padding: No space left on device
  29. E: Sub-process /usr/bin/dpkg returned an error code (2)

重要的是要注意,如果我尝试在我的Mac上启动多个其他图像(从Docker Hub中提取),我会得到类似的“设备上没有空间”错误.所以我认为这个最新的问题可能是由于没有为我的机器上的Docker分配足够的空间(类似于JVM OutOfMemoryException问题).

最佳答案
docker存储其文件文件系统已满.这就是解压缩下载的java archieve时tar压缩的原因.

docker info将显示文件所在的位置,例如

  1. Storage Driver: aufs
  2. Root Dir: /var/lib/docker/aufs

df -h将告诉您文件系统上有多少磁盘空间可用.

使用docker ps -a查找可以删除的容器并使用docker rm -v删除它们(-v很重要,因为它也会删除卷).
使用泊坞窗图像查找不需要的图像,并使用docker rmi将其删除.

您可能有不再需要的悬空图像图层.用docker rmi $(docker images -q -f dangling = true)删除它们.

猜你在找的Docker相关文章