首页 > 解决方案 > 将 docker 镜像拉到 EC2 实例时设备上没有剩余空间(实例中不存在镜像或容器)

问题描述

我需要清理空间,但显然内存在虚拟机中,不知道如何清理它(我是 docker 和 ubuntu 的新手)。这个 EC2 实例中当前没有图像或容器,我已经删除了它们。我在一台窗口PC。

Rae-Djamaal@RaeWallace MINGW64 /c/Program Files/Docker Toolbox
$ ssh -i C:\\Users\\Rae-Djamaal\\Desktop\\Stuff_Removed_to_Be_Returned\\putty\\
glm_ubuntu.pem ubuntu@ec2-3-137-150-28.us-east-2.compute.amazonaws.com
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 5.3.0-1032-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Sep  8 15:34:13 UTC 2020

  System load:  0.0               Processes:              99
  Usage of /:   99.8% of 7.69GB   Users logged in:        0
  Memory usage: 30%               IP address for eth0:    172.31.44.26
  Swap usage:   0%                IP address for docker0: 172.17.0.1

  => / is using 99.8% of 7.69GB


 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch

18 packages can be updated.
0 updates are security updates.


*** System restart required ***
Last login: Tue Sep  8 14:54:08 2020 from 108.28.37.234
ubuntu@ip-172-31-44-26:~$
ubuntu@ip-172-31-44-26:~$ docker pull raedjamw/sf_glm:24.0
24.0: Pulling from raedjamw/sf_glm
6f2f362378c5: Downloading  45.34MB/45.34MB
494c27a8a6b8: Downloading  10.79MB/10.79MB
7596bb83081b: Downloading   4.34MB/4.34MB
372744b62d49: Downloading  50.07MB/50.07MB
615db220d76c: Downloading  215.1MB/215.1MB
1865698adfb0: Downloading  5.747MB/5.747MB
7159b3304cc0: Downloading  20.98MB/20.98MB
ad0713808ef6: Downloading     240B/240B
7ba593904573: Downloading  1.821MB/1.821MB
600301f36ff6: Waiting
b6e81d285b86: Waiting
8d67e206f61c: Downloading   2.64MB/2.64MB
3e2378e7c4a9: Waiting
1764c7ea44b0: Waiting
cfac0d143e72: Waiting
88d5dd814326: Waiting
646c232615bb: Waiting
write /home/docker/tmp/GetImageBlob444753788: no space left on device

标签: dockerubuntuamazon-ec2mingw-w64

解决方案


使用HTOP监控您的本地进程和服务,并使用ncdu检查哪些文件正在占用您的磁盘空间。

首先删除一些文件,以便能够同时安装 htop 和 ncdu。


推荐阅读