简体   繁体   English

使用docker python“设备上没有剩余空间”后无法正确重启ubuntu,外围设备无可用内存

[英]cannot restart correctly ubuntu after use docker python “no space left on device” , no memory available on peripheric

Today i tried to create a docker of the final version of my project(my project has a size of 3.2 Go) with the command "docker build --tag my-python-app". 今天,我尝试使用命令“ docker build --tag my-python-app”创建项目最终版本的docker(我的项目的大小为3.2 Go)。 I had several problems during the manipulation : i ran the command docker. 我在操作过程中遇到了几个问题:我运行了命令docker。 it several times because in the file "Dockerfile", i specified the wrong python and wrong pip. 它几次,因为在文件“ Dockerfile”中,我指定了错误的python和错误的pip。 Anyway, now i have "no space left on device" and my screen is blinking. 无论如何,现在我“设备上没有剩余空间”,并且屏幕闪烁。

For the moment, I tried an autoremove, but still not enough space. 目前,我尝试了自动删除,但仍然没有足够的空间。

Someone has an idea of what is happening? 有人知道发生了什么事吗?

Have you tried to remove unused Docker images or containers? 您是否尝试删除未使用的Docker映像或容器?

You can see the list of images by running: 您可以通过运行以下命令查看图像列表:

docker images

And you can remove them like: 您可以像这样删除它们:

docker rmi <id>

The process is fairly similar for the containers: 容器的过程非常相似:

docker ps -a

And: 和:

docker rm <id>

Be careful not to remove used containers or images. 注意不要取出用过的容器或图像。

Run docker image ls to see if you have any images that you can delete to free up space. 运行docker image ls以查看是否有可删除的图像以释放空间。

If you find images that you do not need, you can remove them individually or all at once. 如果找到不需要的图像,则可以将其单独或全部删除。 Run docker image prune -h to display the options for removing images. 运行docker image prune -h以显示用于删除图像的选项。

I found the problem: When you build your docker, and this print an error, it doesn't delete intermediate containers created in the folder /var/lib/docker/aufs/diff (my error was in the dockerfile, where i precised the wrong python and the wrong pip), and this folder is saved in the peripherical part of the memory. 我发现了问题:构建docker并打印出错误时,它不会删除在/ var / lib / docker / aufs / diff文件夹中创建的中间容器(我的错误在dockerfile中,我在其中修正了错误的python和错误的pip),并且此文件夹保存在内存的外围部分。 So if you take all the memory, your computer is full of bug (screen, keyword, ...) and you can only use your terminal. 因此,如果您占用所有内存,则计算机中充满了bug(屏幕,关键字等),您只能使用终端。 To resolver the problem you have to delete these folders 要解决此问题,您必须删除这些文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM