首页 > 其他分享 >删除docker images中为none的镜像

删除docker images中为none的镜像

时间:2023-05-19 10:00:18浏览次数:43  
标签:ago none chaitin hours images docker sha256 safeline latest

查看现有镜像

➜  safeline docker images
REPOSITORY                  TAG       IMAGE ID       CREATED        SIZE
chaitin/safeline-tengine    1.5.1     25a6146e6aed   13 hours ago   119MB
chaitin/safeline-tengine    latest    25a6146e6aed   13 hours ago   119MB
chaitin/safeline-mgt-api    1.5.1     c32c8a295cef   13 hours ago   510MB
chaitin/safeline-mgt-api    latest    c32c8a295cef   13 hours ago   510MB
chaitin/safeline-mario      1.5.1     97f689e4d3a6   13 hours ago   140MB
chaitin/safeline-mario      latest    97f689e4d3a6   13 hours ago   140MB
chaitin/safeline-tengine    <none>    d0e867c2d3a9   16 hours ago   119MB
chaitin/safeline-mgt-api    <none>    bd3bdff17e6c   16 hours ago   510MB
chaitin/safeline-mario      <none>    2cf6d46a38a4   16 hours ago   140MB
chaitin/safeline-detector   1.5.1     b55e0d111329   17 hours ago   230MB
chaitin/safeline-detector   latest    b55e0d111329   17 hours ago   230MB
chaitin/safeline-detector   <none>    a749c4a748de   17 hours ago   230MB
jc21/nginx-proxy-manager    latest    219fa0ba0547   8 days ago     843MB
postgres                    15.2      bf700010ce28   2 weeks ago    379MB
alpine                      latest    9ed4aefc74f6   7 weeks ago    7.05MB
c0ny1/xss-challenge-tour    latest    53c427561d77   3 years ago    356MB
area39/webug                latest    ea6562434bbd   3 years ago    493MB
c0ny1/upload-labs           latest    aa4fdd1dd211   4 years ago    472MB
c0ny1/sqli-labs             latest    183293ae4238   5 years ago    431MB
➜  safeline

通过grep和awk命令取出TAG为none的images ID

➜  safeline docker images | grep "none" | awk '{print $3}'
d0e867c2d3a9
bd3bdff17e6c
2cf6d46a38a4
a749c4a748de
➜  safeline

通过docker image rm 命令删除

➜  safeline docker image rm `docker images | grep "none" | awk '{print $3}'`
Untagged: chaitin/safeline-tengine@sha256:59b3d502c626e1ad5f1babc4254de21372d471cb1f19855260a33078fddb2b67
Deleted: sha256:d0e867c2d3a904077bc3f771316a3dbeb98ea9f49a3eb66fea177d6c95869a5c
Deleted: sha256:1ec301a2c111062c7d6ab431c214931ba67831ec56e497eab7172fabf4b66af9
Deleted: sha256:87a763184e3818c840d5b3f4dab49ace788850fc94e713283465049bcba043c4
Deleted: sha256:4b682b5ce59f1adb7595b3230c4d4eb0e778b6a8c4d3505c91181f282bfe8ca4
Untagged: chaitin/safeline-mgt-api@sha256:b464fa6bc22e126bde8689e81feb84e58f0e3850ddec3bd7ac70e9e3c5cf9382
Deleted: sha256:bd3bdff17e6ccc1fc83f35f3d2aefa56621140634979aa6e53ce32819e4c160f
Deleted: sha256:7d3df84bfc96bcb503da83ca4f97c4395c272404bb45de80d1e7d570024f8eca
Deleted: sha256:d527a8d8cb7b570e4692d42980bf22926edd92794898e4344a9d99e615031c15
Deleted: sha256:d58cfea0a56c97aa13f47c7f660efe7db6df8b967bcca9167d771e09d1538dc3
Deleted: sha256:52d921e7243d9a520623fef15d28cf3b1ce5f92d2dd7a88b53a096179061c6a7
Untagged: chaitin/safeline-mario@sha256:1268d92e1e2fa39c40f323f5541c41f0c3ac10ab3c7d9782e60a32fea6364c7a
Deleted: sha256:2cf6d46a38a46d64f7e479f6487d1d9cb1b15fe5f54c4f177ef942e2cf82b8c4
Deleted: sha256:bd44fc359e2abc397b29697f872b381a5bb6deacdcd1925a37d591813bcd4e10
Untagged: chaitin/safeline-detector@sha256:4aad591aaf6c8825be4e88b2db57b40a9cdd85380b079ace4b364f32b37eea80
Deleted: sha256:a749c4a748de12553b21d6724a86f8ea3a79591d219f325c26eb7999c9f01897
➜  safeline

查看删除none后的docker镜像

➜  safeline docker images
REPOSITORY                  TAG       IMAGE ID       CREATED        SIZE
chaitin/safeline-tengine    1.5.1     25a6146e6aed   13 hours ago   119MB
chaitin/safeline-tengine    latest    25a6146e6aed   13 hours ago   119MB
chaitin/safeline-mgt-api    1.5.1     c32c8a295cef   13 hours ago   510MB
chaitin/safeline-mgt-api    latest    c32c8a295cef   13 hours ago   510MB
chaitin/safeline-mario      1.5.1     97f689e4d3a6   13 hours ago   140MB
chaitin/safeline-mario      latest    97f689e4d3a6   13 hours ago   140MB
chaitin/safeline-detector   1.5.1     b55e0d111329   17 hours ago   230MB
chaitin/safeline-detector   latest    b55e0d111329   17 hours ago   230MB
jc21/nginx-proxy-manager    latest    219fa0ba0547   8 days ago     843MB
postgres                    15.2      bf700010ce28   2 weeks ago    379MB
alpine                      latest    9ed4aefc74f6   7 weeks ago    7.05MB
c0ny1/xss-challenge-tour    latest    53c427561d77   3 years ago    356MB
area39/webug                latest    ea6562434bbd   3 years ago    493MB
c0ny1/upload-labs           latest    aa4fdd1dd211   4 years ago    472MB
c0ny1/sqli-labs             latest    183293ae4238   5 years ago    431MB
➜  safeline

标签:ago,none,chaitin,hours,images,docker,sha256,safeline,latest
From: https://www.cnblogs.com/amsilence/p/17414078.html

相关文章

  • 转载【环境搭建】docker+nginx部署PHP
      目的使用docker容器完成nginx的安装以及部署PHP网页步骤一、安装nginx1.拉取Nginx镜像dockerpullnginx//拉取镜像dockerimages//查看本地镜像这里注意需要记一下nginx的IMAGEID,我这里的ID是605c2.创建Nginx容器dockerrun--nam......
  • docker安装nginx
    dockerpullregistry.cn-hangzhou.aliyuncs.com/ns-w/wh-w:nginx-1.22.0创建挂载目录mkdir-p/opt/resource/nginx/confmkdir-p/opt/resource/nginx/logmkdir-p/opt/resource/nginx/html生成容器dockerrun--namenginx-1.22.0-p80:80-dregistry.cn-hangzhou.aliy......
  • Docker安装Airflow
    环境系统:Ubuntu22.04.2LTSdockerVersion:20.10.21docker-composeversion1.29.2,python3--versionPython3.10.61、安装docker1.1先更新系统 sudoapt-getupdate sudoapt-getupgrade1.2安装docker: apt-getinstalldocker.io1.3查看docker版本: ......
  • 解决mysql自动插入的日期时间和现在的时间不一致的问题(基于docker)
    新建表的时候发现插入的时间还是早上 先查看配置文件的对不对 配置文件没问题问题只能出在服务器了,连上Linux 查看本机的时间没问题进入容器dockerexec-itmysql./bin/bash 日期明显有问题了进入mysqlmysql-uroot-pshowglobalvariabl......
  • docker-compose 部署 es8.7
    https://blog.51cto.com/wangguishe/6177453系统设置sysctl.conf#echovm.max_map_count=262144>>/etc/sysctl.conf   ulimits#dockerrun--rmdocker.elastic.co/elasticsearch/elasticsearch:8.7.0/bin/bash-c'ulimit-Hn&&a......
  • 如何解决dotnet程序打包的docker镜像创建容器后容器内的date时间正确但是dotnet获取到
    这个问题通常是由于时区设置不正确导致的。你可以尝试以下解决方法:在Dockerfile中设置时区:在Dockerfile中添加以下命令:RUNln-sf/usr/share/zoneinfo/Asia/Shanghai/etc/localtime这将设置容器的时区为上海时区。你也可以替换成你所在的时区。在dotnet程序中设置时区:......
  • 关于Docker报错
    idea连接docker里的mysql镜像时报错:[28000][1045]Accessdeniedforuser'root'@'172.17.0.1'(usingpassword:YES) 解决:命令:dockerexec-itmysql/bin/bash进入mysql:mysql-uroot-proot开启远程访问:ALTERUSER'root'@'%'IDENTIFIED......
  • OpenHarmony Docker移植实践
      Docker简介从操作系统诞生之日起,虚拟化技术就不断的演进与发展,结合目前云原生的发展态势,容器无疑是其中的重要一环。Docker是一个开源的软件项目,可以在Linux操作系统上提供一层额外的抽象,让用户程序部署在一个相对隔离的运行环境,并提供自动管理机制。需要额外指出的是......
  • Windows下安装docker desktop
    Windows下安装dockerdesktop官网下载安装程序.exe官网:https://docs.docker.com/desktop/install/windows-install/打开虚拟化WSL2控制面板程序启用或关闭Window功能勾选“适用于Linux的Windows子系统”&“虚拟机平台”确认后,重启电脑管理员身份打开命令提示符......
  • 使用buildx在x86机器上面编译arm64架构的Docker镜像
    buildx多架构编译安装docker下载docker下载buildx安装架构支持dockerrun--privileged--rmtonistiigi/binfmt--installall创建一个自己的空间buildxcreate--use--namemybuilder检查支持的架构buildxinspectmybuilder--bootstrapNodes:Name:mybu......