Arch Linux,Docker"设备上没有空间。"

时间:2016-07-27 17:10:43

标签: linux docker archlinux

我看到的所有类似问题都是通过清理图像或容器或孤立卷来解决的,但我没有遇到任何问题。我甚至完全删除了/var/lib/docker,但仍然没有。

相关产出:

[N] ⋊> ~/W/W/cocagne on master ⨯ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -v /var/lib/docker:/var/lib/docker martin/docker-cleanup-vol
umes
docker: Error response from daemon: Container command '/usr/local/bin/docker-cleanup-volumes.sh' not found or does not exist..
[N] ⋊> ~/W/W/cocagne on master ⨯ docker-compose build                                                                                                11:56:23
mysql uses an image, skipping
Building vitess
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 9, in <module>
    load_entry_point('docker-compose==1.7.1', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python3.5/site-packages/compose/cli/main.py", line 58, in main
    command()
  File "/usr/lib/python3.5/site-packages/compose/cli/main.py", line 109, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3.5/site-packages/compose/cli/main.py", line 213, in build
    force_rm=bool(options.get('--force-rm', False)))
  File "/usr/lib/python3.5/site-packages/compose/project.py", line 300, in build
    service.build(no_cache, pull, force_rm)
  File "/usr/lib/python3.5/site-packages/compose/service.py", line 718, in build
    buildargs=build_opts.get('args', None),
  File "/usr/lib/python3.5/site-packages/docker/api/build.py", line 54, in build
    path, exclude=exclude, dockerfile=dockerfile, gzip=gzip
  File "/usr/lib/python3.5/site-packages/docker/utils/utils.py", line 103, in tar
    t.add(os.path.join(root, path), arcname=path, recursive=False)
  File "/usr/lib/python3.5/tarfile.py", line 1938, in add
    self.addfile(tarinfo, f)
  File "/usr/lib/python3.5/tarfile.py", line 1966, in addfile
    copyfileobj(fileobj, self.fileobj, tarinfo.size)
  File "/usr/lib/python3.5/tarfile.py", line 244, in copyfileobj
    dst.write(buf)
  File "/usr/lib/python3.5/tempfile.py", line 483, in func_wrapper
    return func(*args, **kwargs)
OSError: [Errno 28] No space left on device
[I] ⋊> ~/W/W/cocagne on master ⨯ docker ps -a                                                                                                        11:56:30
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[I] ⋊> ~/W/W/cocagne on master ⨯ docker ps -q                                                                                                        11:57:25
[I] ⋊> ~/W/W/cocagne on master ⨯ docker image -q                                                                                                     11:57:28
docker: 'image' is not a docker command.
See 'docker --help'.
[I] ⋊> ~/W/W/cocagne on master ⨯ docker images -a                                                                                                    11:57:39
REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
martin/docker-cleanup-volumes   latest              8c41df286c03        12 weeks ago        22.12 MB
[I] ⋊> ~/W/W/cocagne on master ⨯ df -h                                                                                                               11:57:41
Filesystem      Size  Used Avail Use% Mounted on
dev             3.9G     0  3.9G   0% /dev
run             3.9G  832K  3.9G   1% /run
/dev/sda4        27G  9.1G   17G  36% /
tmpfs           3.9G   64M  3.8G   2% /dev/shm
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           3.9G   32K  3.9G   1% /tmp
/dev/sda1        42G   16G   25G  39% /home
/dev/sda2        42G  9.4G   30G  24% /var
/dev/sda5       1.3G   32M  1.3G   3% /boot
tmpfs           790M   12K  790M   1% /run/user/1000
[I] ⋊> ~/W/W/cocagne on master ⨯                                                                                                                     11:57:54

码头信息

[I] ⋊> ~/W/W/cocagne on master ⨯ docker info                                                                                                         12:01:55
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.11.2
Storage Driver: devicemapper
 Pool Name: docker-8:2-2359321-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 11.8 MB
 Data Space Total: 107.4 GB
 Data Space Available: 34.57 GB
 Metadata Space Used: 581.6 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.131 (2016-07-15)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: null host bridge
Kernel Version: 4.6.4-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.706 GiB
Name: crockford
ID: HO2U:ELWR:LDB3:PMEY:5YOJ:D7YJ:2HJA:PVYG:45K2:J6KI:D6WO:4RUE
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/

有一件事让我的问题有所不同(我认为问题的根源来自哪里)

在为/var创建一个单独的分区之前,它位于我的根分区上,最终超出了分区。一旦最大化,我缩小了我的主分区,创建了一个/ var分区,将我的root /var复制到我的新/var,并删除了我的旧/var。但出于某种原因,码头工人仍然认为它的最大化?我不知道。

我还尝试将docker与sudo pacman -S docker进行树干,但没有。

编辑:我刚用普通的docker build .尝试过,效果很好。不知何故,docker-compose认为它已经失去了记忆力?

2 个答案:

答案 0 :(得分:6)

来自docker-compose的python堆栈跟踪表明它似乎无法创建临时文件。这表示/tmp中没有剩余空格。

OP提到他的RAM在评论中运行docker-compose时完全消耗掉了。鉴于此/tmp已安装在tmpfs上,因此Python / docker-compose无法在/tmp中创建任何临时文件。

可能的解决方案是:

  • 通过设置以下环境变量之一暂时切换默认的临时文件生成位置:TMPDIRTEMPTMP(参考:Python doc
  • /tmp更改为而不是使用tmpfs并改用磁盘。
  • 增加计算机上的RAM / Swap空间量。 (您可以在不弄乱分区的情况下增加交换like so)。 tmpfs由易失性存储支持,这意味着RAM和Swap在理论上应该可以工作。

请注意,大多数这些情况都会导致应用程序速度变慢,尤其是在docker构建过程I / O很重的情况下。

答案 1 :(得分:1)

试试这个:

mount -o remount,size=4G,noatime /tmp