Harbor私有仓库中如何彻底删除镜像释放存储空间?
简介:
Harbor私有仓库运行一段时间后,仓库中存有大量镜像,会占用太多的存储空间。直接通过Harbor界面删除相关镜像,并不会自动删除存储中的文件和镜像。需要停止Harbor服务,执行垃圾回收命令,进行存储空间清理和回收。
相关资料:
1、Harbor用户手册中的相关说明:
Next, delete the actual files of the repository using the registry's garbage collection(GC). Make sure that no one is pushing images or Harbor is not running at all before you perform a GC. If someone were pushing an image while GC is running, there is a risk that the image's layers will be mistakenly deleted which results in a corrupted image. So before running GC, a preferred approach is to stop Harbor first.
Run the below commands on the host which Harbor is deployed on to preview what files/images will be affected:
#要启用垃圾回收(GC),首先要关闭Harbor服务,然后再执行清理命令
#停止Harbor相关服务
$ docker-compose stop
#使用--dry-run参数运行容器,预览运行效果,但不删除任何数据
$ docker run -it --name gc --rm --volumes-from registry vmware/registry:2.6.2-photon garbage-collect --dry-run /etc/registry/config.yml
#NOTE: The above option "--dry-run" will print the progress without removing any data.
Verify the result of the above test, then use the below commands to perform garbage collection and restart Harbor.
#不使用--dry-run参数,将删除相关的文件和镜像,
$ docker run -it --name gc --rm --volumes-from registry vmware/registry:2.6.2-photon garbage-collect /etc/registry/config.yml
#重新启动Harbor相关服务
$ docker-compose start
图1:01-先在Harbor UI图形界面中删除不需要的镜像
图2:02-停止Harbor服务,执行垃圾回收命令
2、数人云CTO肖总微信公号的文章:
图3:老肖说两句截图
图4:数人云CTO肖总-微信公众号-老肖说两句
参考链接:
Harbor用户指南
https://github.com/vmware/harbor/blob/master/docs/user_guide.md
删除容器镜像仓库中的容器镜像到底有多难?
Garbage collection
https://github.com/docker/docker.github.io/blob/master/registry/garbage-collection.md
Harbor私有仓库中如何彻底删除镜像释放存储空间?的更多相关文章
- 删除docker私有仓库中的镜像
1.搭建私有仓库 (1)拉取私有仓库镜像 docker pull registry(2)启动私有仓库容器 docker run ‐di ‐‐name=registry ‐p 5000:5000 reg ...
- 在jenkins中使用shell命令推送当前主机上的docker镜像到远程的Harbor私有仓库
1.jenkins主机上的docker配置 先在Jenkins主机的docke上配置上Harbor私有仓库地址 cat /etc/docker/daemon.json { "insecure ...
- 配置 Containerd 在 harbor 私有仓库拉取镜像
官方文档地址:https://github.com/containerd/cri/blob/master/docs/registry.md 严格来说,这个具体可分为两部分 1.在k8s中使用Conta ...
- 一步步搭建docker私有仓库并从私有仓库中下载镜像
一步步搭建docker私有仓库 #下载镜像 docker pull registry#查看镜像 docker images #运行私有仓库,指定端口和数据卷 docker run -d -p : -v ...
- 部署 harbor 私有仓库
安装下载依赖包 安装docker-compose 从 docker compose 发布页面下载最新的 docker-compose 二进制文件,本文以1.25.4为例 cd /opt/k8s/wor ...
- Docker Harbor私有仓库部署与管理 (超详细配图)
Docker Harbor私有仓库部署与管理 1.Harbor 介绍 2.Harbor部署 3.Harbor管理 1.Harbor 介绍: 什么是 Harbor ? Harbor 是 VMware 公 ...
- Centos7搭建Harbor私有仓库(二)
1 说明 前文Centos7搭建Harbor私有仓库(一)中成功搭建了Harbor,但,是以http方式搭建的,这里我们修改为https方式 以下基于镜像CentOS-7-x86_64-Minimal ...
- 创建Harbor私有仓库
前提 1.安装docker服务 参考:https://blog.csdn.net/weixin_36522099/article/details/108861134 老名字:docker.docker ...
- 搭建harbor私有仓库
2-1.项目说明 Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,由VMware开源,其通过添加一些企业必需的功能特性,例如安全.标识和管理等,扩展了开源 Docke ...
随机推荐
- javascript数组的内置对象Array
javascript的内置对象Array是用于构造数组的全局对象,数组是类似于列表的高阶对象. 创建数组的方法: 1通过字面量:var arr = [1,2,3]; 里面的参数直接作为数组里的值 2通 ...
- lower_bound && upper_bound
用lower_bound进行二分查找 ●在从小到大排好序的基本类型数组上进行二分查找. 这是二分查找的一种版本,试图在已排序的[first,last)中寻找元素value.如果[first,last ...
- 渗透常用dos命令,http协议及数据提交方式。 hack 某某
dir查看目录 cd 切换目录 strat www.xxx.com 打开网页 del 删除文件 cls 清屏幕命令 ipconfig 查看ip地址 netstat -an 显示网络连接.路由 ...
- 线程同步-SpinWait
这次将描述如何不适用内核模式的方式来使线程等待.SpinWait,它是一个混合同步构造,被设计为使用用户模式等待一段时间,然后切换到内核模式以节省CPU时间. 代码Demo: using System ...
- Windows 10 Creators Update [ISO官方镜像][15063][1703][x64][x86][创意者更新正式版]
请把下载地址手动复制到迅雷里面去,谢谢! [64 位简体中文专业/家庭版] 文件名:cn_windows_10_multiple_editions_version_1703_updated_march ...
- Linux 从源码编译安装 OpenSSH
https://blog.csdn.net/bytxl/article/details/46639073 Linux 从源码编译安装 OpenSSH以及各问题解决 2015年06月25日 17:37: ...
- 对text字段聚合,没有设置fielddate所以出错
http://192.168.60.26:9200/linewell_assets_mgt_es_yh_test/lw_devices/ _mapping { "properties&quo ...
- RoR- Database setup& SQLite ... Migrations
*rails uses SQLite for database by default *Built-in command-line DB viewer *Self-contained,server-l ...
- git本地仓库 push到远程仓库出现错误
! [rejected] master -> master (fetch first) error: failed to push some refs to hint: Updates were ...
- safari手机浏览器的width:100%的自适应问题
Tips: 调试 iPad 或 iPhone 可在设置中启动调试模式,在 Mac 中的 Safari 浏览器 同样开启开发者模式后,进行联机调试.功能彪悍. 最近在做一个页面时,发现在 iPad 的 ...