我们使用Jenkins构建Docker镜像,直到上周才发现所有内容,每当我尝试在Jenkins中构建映像时,它都会失败并显示“来自守护程序的错误响应:处理tar文件时出错(退出状态1)”:write / app / node_modules / acorn / dist / acorn_loose.es.js:设备上没有剩余空间“(它失败的文件可能取决于项目)。如果我尝试在服务器中使用Docker但是在Jenkins上失败,则会构建映像。
我试过删除旧容器和图像等但无济于事。磁盘空间和inode似乎很好,所以我不确定现在要尝试什么。任何帮助表示赞赏。
“码头信息”的结果:
Containers: 55
Running: 48
Paused: 0
Stopped: 7
Images: 59
Server Version: 17.03.2-ce
Storage Driver: overlay
Backing Filesystem: extfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.45-rancher
Operating System: RancherOS v1.1.0
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 19.61 GiB
Name: rancher
ID: Z7Z3:T3NW:N4O3:FKMZ:7KH6:FJ7R:TJ6A:FXLW:KNUL:WMRC:ED74:KHEM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
dockerhub.companysite.net:5000
127.0.0.0/8
Live Restore Enabled: false
“df -h”的结果:
Filesystem Size Used Avail Use% Mounted on
overlay 47G 27G 18G 60% /
tmpfs 9.9G 0 9.9G 0% /dev
tmpfs 9.9G 0 9.9G 0% /sys/fs/cgroup
/dev/sda1 47G 27G 18G 60% /.r
shm 64M 0 64M 0% /dev/shm
tmpfs 9.9G 0 9.9G 0% /sys/firmware
“df -ih”的结果:
Filesystem Inodes IUsed IFree IUse% Mounted on
overlay 13M 2.8M 9.8M 22% /
tmpfs 2.5M 16 2.5M 1% /dev
tmpfs 2.5M 15 2.5M 1% /sys/fs/cgroup
/dev/sda1 13M 2.8M 9.8M 22% /.r
shm 2.5M 1 2.5M 1% /dev/shm
tmpfs 2.5M 1 2.5M 1% /sys/firmware
您可能有一堆旧的悬空图像导致问题,请尝试:
docker volume rm $(docker volume ls -qf dangling=true)
(这确实会删除内容,因此您可能需要检查在执行此操作之前,您是否希望在任何悬空卷中保留任何内容)
您应该清理旧容器,图像和卷。您可以使用prune仅使用一个命令将其删除:
docker system prune
删除所有未使用的容器,网络,图像(悬空和未引用)以及可选的卷。
输出:
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all build cache
Are you sure you want to continue? [y/N] y