Docker:Failed to copy files, no space left on device
主页
- 个人微信公众号:密码应用技术实战
- 个人博客园首页:https://www.cnblogs.com/informatics/
问题描述
在Mac上进行docker构建时,偶尔会遇到以下问题
Failed to copy files: userspace copy failed:
write /var/lib/docker/volumes/xxx/_data/xxx.dbf:
no space left on device
这种问题一般是由于频繁进行docker构建和运行,每次构建都会保留一些临时文件,占用了大量的存储空间。如果镜像、容器和本地Volume等docker相关的持久化存储消耗空间较大,再进行docker的构建和运行就会碰到以上问题。
解决方案
- 使用
docker system df命令查看docker持久化存储占用情况
➜ ~ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 49 13 34.04GB 31.1GB (91%)
Containers 14 1 5.761GB 5.752GB (99%)
Local Volumes 0 0 0B 0B
Build Cache 177 0 11.39GB 11.39GB
发现Containers占用了大量空间
- 清理Containers
# 清理containers
➜ ~ docker rm `docker ps -aq`
# 重新查看docker持久化存储占用空间
➜ ~ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 49 1 34.04GB 34.04GB (100%)
Containers 1 1 8.367MB 0B (0%)
Local Volumes 0 0 0B 0B
Build Cache 177 0 11.39GB 11.39GB
从上面命令输出可以看出,Containers占用的存储已被大部分回收。
docker命令
- 清理无名docker images
# 查询无名docker镜像
➜ ~ docker images | grep none
<none> <none> 71ee97a16e71 47 minutes ago 823MB
<none> <none> 2016ba05a0bd 58 minutes ago 1.04GB
<none> <none> f9e7ceb56af9 About an hour ago 1.04GB
<none> <none> 6da657f62f88 About an hour ago 1.04GB
# 清理无名docker镜像
➜ ~ docker images | grep 'none' | awk '{print $3}' | xargs docker rmi
Deleted: sha256:71ee97a16e718bfed27e77aa20ce7a84613bc9db654880ae0572c3790f72e818
Deleted: sha256:84332b4724450b9387e8170a8e97f32a91c0a901ce7f79a811c244085559dc0a
Deleted: sha256:11de3bb1714a313d0f0c4c6815743c0b708e68da9bfbb3c6cbf4590f15b6bc59
Deleted: sha256:54f0f4c036757c04ce32abe8a0f008e67e39706214ce7fd346a80b7dbc6b4953
Deleted: sha256:19d81f07d04b03f24569a3d6297bccfbb91cf96cc750aac32ef7fa0e4acee131
Deleted: sha256:e8c8a6bde26ebde25f5b4302b57191aea15f71dcf345a8f1e6918b95a18db1ef
Deleted: sha256:2016ba05a0bd8e8d8ccb33dd437e4f50e3092751df1dc12633bbe0eb507c6bad
Deleted: sha256:b99f41317039f1d957ccea10817f76264bf8605c5167c033e5b4b2b725211698
Deleted: sha256:c1aea5e7327bed7c2358dc423e04dc952f495af067b3605937958fe92dd159af
Deleted: sha256:06304242456d6a4a6e4a860aee2e9c744a1c875c5fd6b2153780661ff34b26de
Deleted: sha256:f9e7ceb56af954bf393ec2ca414a4210f8fc99dc0174a5ef1cfcac718ee0698d
- 清理docker volumes
docker volume ls | awk '{print $2}' | xargs -I {} docker volume rm {}
Docker:Failed to copy files, no space left on device的更多相关文章
- Objective-C 关键字:retain, assgin, copy, readonly,atomic,nonatomic
声明式属性的使用:声明式属性叫编译期语法 @property(retain,nonatomic)Some *s; @property(参数一,参数二)Some *s; 参数1:retain:修饰引用( ...
- Docker:虚拟机挂起后,再启动docker容器连接失败
问题描述 当我们使用VMware15 Pro 创建虚拟机并运行Linux搭建的Docker时,挂起虚拟机后再次运行发现访问Docker容器失败. 解决方式 我们正常的挂起其实是:挂起客户机,博主尝试 ...
- 解决编译报错:Unable to copy file, because it is being used by another process.
Error 63 Unable to copy file "D:\DEV\XXX Website\trunk\4 Source Code\Common\WebControls\b ...
- Junit 报错: Failed to load ApplicationContext
今天在使用Junit测试时候,报了个错误: Failed to load ApplicationContext, aspect not found;挺奇怪的 我又没有调用你,之前还好好的,现在不能使用 ...
- docker报错:Failed to restart docker.service: Unit not found.
前言:我之前安装好docker了,但是关机重启后,发现docker就没了 报错:Failed to restart docker.service: Unit not found. 解决方法: 1. ...
- docker 报错: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
centos 启动docker服务报错: Job for docker.service failed because the control process exited with error cod ...
- 运行Virtualbox去安装系统时出错:Failed to open a session for the virtual machine,Unable to load R3 module xxxx/VBoxDD.DLL(VBoxDD)
貌似看到不少人(1,2,3),在使用Virtualbox去安装系统时,都遇到这个错误: 比如这里遇到的: 截图: 和另外这里的截图: 加文字描述: Failed to open a session f ...
- 从2月14号開始,上传AppStore会碰到:Failed to locate or generate matching signing assets
从2月14号開始,上传AppStore时可能会碰到这个问题: Failed to locate or generate matching signing assets Xcode attempted ...
- docker—tomcat 报错:Failed to get D-Bus connection: Operation not permitted
docker search centos 查系统镜像 docker pull docker.io/centos 进入容器 [root@git opt]# docker images REPOSIT ...
- Thrift报错:Error: Thrift compiler: Failed to translate files. Error: Cannot run program thrift error=2
文章目录 报错: 原因: 解决: 报错: Error: Thrift compiler: Failed to translate files. Error: Cannot run program th ...
随机推荐
- 用Unity3D做游戏开发在Android上的常用调试方法
Hdg Remote Debug 远程调试 游戏运行在手机上,可以通过pc端的unity来随时修改当前场景中GameObject的变量,从而改变手机上运行时的表现.比如,我可以勾掉下图中的" ...
- .NET MAUI 简介
欢迎使用.NET 多平台应用程序 UI.此版本标志着我们在统一 .NET 平台的多年旅程中的新里程碑.现在,您和超过 500 万其他 .NET 开发人员拥有面向 Android.iOS.macOS 和 ...
- Paddle模型性能分析工具Profiler:定位瓶颈点、优化程序、提升性能
项目链接,fork一下即可使用 https://aistudio.baidu.com/aistudio/projectdetail/4482932?contributionType=1 Paddle模 ...
- C/C++ 使用API实现数据压缩与解压缩
在Windows编程中,经常会遇到需要对数据进行压缩和解压缩的情况,数据压缩是一种常见的优化手段,能够减小数据的存储空间并提高传输效率.Windows提供了这些API函数,本文将深入探讨使用Windo ...
- 14.3 Socket 字符串分块传输
首先为什么要实行分块传输字符串,一般而言Socket套接字最长发送的字节数为8192字节,如果发送的字节超出了此范围则后续部分会被自动截断,此时将字符串进行分块传输将显得格外重要,分块传输的关键在于封 ...
- Celery Worker log 中记录 task_id
import inspect import logging import threading from logging import Logger as Logger, LogRecord from ...
- 遥感图像处理笔记之【Automatic Flood Detection from Satellite Images Using Deep Learning】
遥感图像处理学习(7) 前言 遥感系列第7篇.遥感图像处理方向的学习者可以参考或者复刻 本文初编辑于2023年12月29日 2024年1月24日搬运至本人博客园平台 文章标题:Automatic Fl ...
- 每日一道Java面试题:说一说Java中的泛型?
写在开头 今天的每日一道Java面试题聊的是Java中的泛型,泛型在面试的时候偶尔会被提及,频率不是特别高,但在日后的开发工作中,却是是个高频词汇,因此,我们有必要去认真的学习它. 泛型的定义 什么是 ...
- 在Visual Studio中部署GDAL库的C++版本(包括SQLite、PROJ等依赖)
本文介绍在Visual Studio软件中配置.编译C++环境下GDAL库.SQLite环境与PROJ库的详细方法. GDAL库是一个非常方便的地理数据处理库,但其在C++环境下的配置与编译流 ...
- 【图论】【Matlab】最小生成树之Kruskal算法【贪心思想超详细详解Kruskal算法并应用】
最小生成树之Kruskal算法 注意:内容学习来自:b站CleverFrank数模算法精讲 导航 前言 实际问题引入 Kruskal算法 整体代码展示 尾声 前言 博主今天给大家带来的是最小生成树中两 ...