主页

问题描述

在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的构建和运行就会碰到以上问题。

解决方案

  1. 使用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占用了大量空间

  1. 清理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命令

  1. 清理无名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
  1. 清理docker volumes
docker volume ls | awk '{print $2}' | xargs -I {} docker volume rm {}

Docker:Failed to copy files, no space left on device的更多相关文章

  1. Objective-C 关键字:retain, assgin, copy, readonly,atomic,nonatomic

    声明式属性的使用:声明式属性叫编译期语法 @property(retain,nonatomic)Some *s; @property(参数一,参数二)Some *s; 参数1:retain:修饰引用( ...

  2. Docker:虚拟机挂起后,再启动docker容器连接失败

    问题描述 当我们使用VMware15 Pro 创建虚拟机并运行Linux搭建的Docker时,挂起虚拟机后再次运行发现访问Docker容器失败. 解决方式  我们正常的挂起其实是:挂起客户机,博主尝试 ...

  3. 解决编译报错: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 ...

  4. Junit 报错: Failed to load ApplicationContext

    今天在使用Junit测试时候,报了个错误: Failed to load ApplicationContext, aspect not found;挺奇怪的 我又没有调用你,之前还好好的,现在不能使用 ...

  5. docker报错:Failed to restart docker.service: Unit not found.

    前言:我之前安装好docker了,但是关机重启后,发现docker就没了 报错:Failed to restart docker.service: Unit not found.   解决方法: 1. ...

  6. 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 ...

  7. 运行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 ...

  8. 从2月14号開始,上传AppStore会碰到:Failed to locate or generate matching signing assets

    从2月14号開始,上传AppStore时可能会碰到这个问题: Failed to locate or generate matching signing assets Xcode attempted ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. 用Unity3D做游戏开发在Android上的常用调试方法

    Hdg Remote Debug 远程调试 游戏运行在手机上,可以通过pc端的unity来随时修改当前场景中GameObject的变量,从而改变手机上运行时的表现.比如,我可以勾掉下图中的" ...

  2. python3 牛客网:OJ在线编程常见输入输出练习(ACM模式)

    牛客网: 校招笔试真题_C++工程师.golang工程师_牛客网 其他语言输入输出见链接 1.输入两个数,输入数据包括多组. while True: try: a = list(map(int,inp ...

  3. C/C++ 实现简易HTTP服务器

    #include <stdio.h> #include <stdlib.h> #include <process.h> #include <WinSock2. ...

  4. Spring声明式事务控制配置

    xml配置(配置文件) <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="h ...

  5. 在Spring Cloud 2020中使用Consul配置中心遇到的问题

    升级Spring Cloud 2020后发现Consul配置中心失效了,配置中心的配置和bootstrap.yml中的配置都没有生效. 话不多说,先看官方文档:https://docs.spring. ...

  6. IntPtr 来把指针转换为 Int

    由于想得到指针的值,这个时候,不能把指针强制转换为 integer 因为 integer 只适合32位的系统,64位的系统下,需要用 int64, 通过这个函数来转换,就可以屏蔽掉系统是32位 还是 ...

  7. .NET Core开发实战(第7课:用Autofac增强容器能力)--学习笔记(下)

    07 | 用Autofac增强容器能力:引入面向切面编程(AOP)的能力 如何获取没有命名的服务呢? // Autofac 容器获取实例的方式是一组 Resolve 方法 var service = ...

  8. NC15434 wyh的迷宫

    题目链接 题目 题目描述 给你一个n*m的迷宫,这个迷宫中有以下几个标识: s代表起点 t代表终点 x代表障碍物 .代表空地 现在你们涵哥想知道能不能从起点走到终点不碰到障碍物(只能上下左右进行移动, ...

  9. NC50959 To the Max

    题目链接 题目 题目描述 Given a two-dimensional array of positive and negative integers, a sub-rectangle is any ...

  10. NC16615 [NOIP2008]传纸条

    题目链接 题目 题目描述 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题.一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接 ...