harbor仓库镜像的删除

刚开始自己摸索了下,直接webui界面删除后,发现仓库空间未释放

上传之前仓库空间占用为

上传之后仓库空间占用为

在webui界面上删除镜像后

查看大小

依旧为286m,到是什么原因呢,通过官方github查看使用文档,终于找到了解决办法,那就是在webui删除镜像是软删除,并不会释放空间,在

webui界面删除后必须停止harbor后再进行硬删除,也就是空间释放,垃圾回收,下面是官方文档原文

Deleting repositories

Repository deletion runs in two steps.

First, delete a repository in Harbor's UI. This is soft deletion. You can delete the entire repository or just a tag of it. After the soft deletion, the repository is no longer managed in Harbor, however, the files of the repository still remain in Harbor's storage.

CAUTION: If both tag A and tag B refer to the same image, after deleting tag A, B will also get deleted. if you enabled content trust, you need to use notary command line tool to delete the tag's signature before you delete an image.

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:

$ docker-compose stop

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

$ docker run -it --name gc --rm --volumes-from registry vmware/registry:2.6.2-photon garbage-collect  /etc/registry/config.yml

$ docker-compose start

For more information about GC, please see GC.

官方已经说的很明白了,第一个run是只打印出来已删除镜像,但不进行空间释放和垃圾回收,执行下面的一个run,成功释放空间了。

执行垃圾回收命令 docker run -it --name gc --rm --volumes-from registry vmware/registry:2.6.2-photon garbage-collect  /etc/registry/config.yml 自行参照镜像名称修改

释放过程截图

启动harbor

查看空间是否释放

我们的空间回来了

再上传一次试试?

证明没问题,可以上传。

也可以下载

至此,仓库空间释放,垃圾回收告一段落

附上官方文档地址

https://github.com/vmware/harbor/blob/master/docs/user_guide.md

harbor仓库镜像的删除的更多相关文章

  1. 搭建Harbor私有镜像仓库--v1.5.1

     搭建Harbor私有镜像仓库--v1.5.1 1.介绍 Docker容器应用的开发和运行离不开可靠的镜像管理,虽然Docker官方也提供了公共的镜像仓库,但是从安全和效率等方面考虑,部署我们私有环境 ...

  2. 部署Harbor私有镜像仓库

    Harbor私有镜像仓库无坑搭建 目录 1. harbor介绍 2. docker-ce的安装 3. docker-compose的安装 4. Harbor私有仓库的安装 5. 客户端连接镜像仓库配置 ...

  3. 03: 使用docker搭建Harbor私有镜像仓库

    1.1 harbor介绍 1.Harbor简介 1. Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器. 2. 镜像的存储harbor使用的是官方的docker regi ...

  4. 阿里云镜像仓库镜像迁移至私有Harbor

    下载镜像同步工具 wget https://goodrain-delivery.oss-cn-hangzhou.aliyuncs.com/boe/image-syncer && chm ...

  5. 离线手动部署docker镜像仓库——harbor仓库(HTTPS)

    实验环境: harbor服务器系统:CentOS Linux release 7.5.1804 (Core)harbor服务器IP:10.1.12.114harbor版本:v1.5.0docker版本 ...

  6. Harbor私有镜像仓库(上)

    上图配置为工作环境 特别注意:win10现在不允许使用私有ca证书,到时登录浏览器会失败,可以选用火狐浏览器. 创建自己的CA证书 openssl req -newkey rsa:4096 -node ...

  7. [Docker]Docker拉取,上传镜像到Harbor仓库

    需求 因为项目的需求,需要制作一个基于tomcat的镜像.那么前提就是,需要有tomcat的基础镜像. 怎么做 我的思路跑偏了,本来以为是需要将tomcat下载下来,然后通过docker命令,让它成为 ...

  8. harbor私有镜像仓库的搭建与使用与主从复制

    harbor私有镜像仓库,私有仓库有两种,一种是harbor,一种是小型的私有仓库,harbor有两种模式,一种是主 从,一种是高可用仓库,项目需求,需要两台服务器,都有docker.ldap权限统一 ...

  9. Docker registry 私有仓库镜像查询、删除、上传、下载 shell

    #Docker官方私有仓库registry #官方只提供了API接口,不方便使用,就写了个shell #docker-registry安装配置http://www.cnblogs.com/elvi/p ...

随机推荐

  1. Unix.Trojan.DDoS_XOR-1木马症状及清理办法

    父进程名称: crond 进程名称: bash 进程路径: /usr/bin/bash 进程id: 20,517 命令行参数: /bin/sh /etc/cron.hourly/cron.sh 事件说 ...

  2. java第一次考试

    这是我们开学的第一次Java课的考试,考的我有点害怕. 老师说这是给我们在正式上课之前提个醒,确实,我明白了我在学习方面还有多大的差距,确实,就如我高中同学所说的那样,没事就应该往机房跑了. 在上个学 ...

  3. 造excel表格横、列数据每一格自动累加填充效果

    1.需求 excel每个横格子和竖格子number数据不一致的情况,保持如下金额字段每次自动累加 2.步骤: 1)设置excel格子为number格式(可以不要小数) 2)选中需要增序的单元格,选择e ...

  4. windows设置电脑的固定IP

    当有需要的人往往想要固定自己的IP进行测试,在我通过手机代理来录制测试带宽时不想因为IP经常变更而影响到我的测试 因此,我想要固定自己的IP 1.想要固定IP说明自己的IP设置成了自动获取方式,这样连 ...

  5. WPF DataGrid多表头/列头,多行头,合并单元格,一列占据多行

    先上效果图: 思路说明:这是两个DataGrid,没有嵌套,位置和高度保持一致,在加上ScrollViewer滚动条,这就像是在一个DataGrid中. 缺点: 因为最外层有透明的Border,所以没 ...

  6. 三种常见的Web安全问题

    XSS漏洞 1.XSS简介 跨站脚本(cross site script)简称为XSS,是一种经常出现在web应用中的计算机安全漏洞,也是web中最主流的攻击方式. XSS是指恶意攻击者利用网站没有对 ...

  7. 关于W8.1不能安装VS2015(包括2017等)

    电脑本来是W7 64位+OPENCV3.1,今天突然系统崩溃了,然后感觉W7过时了遇到很多问题直接系统崩溃还得了啊,干脆装了一个W8.1了. 好吧~~本来想直接说问题的,干脆先把装系统给记录一下--& ...

  8. Windows下GO开发环境配置

    GO下载                 https://golang.org/dl/ IDE-goland下载    http://www.jetbrains.com/go/ 本次安装go1.9.3 ...

  9. 解决Cell重用问题

    在显示的过程中,出现了内容重叠的问题,其实就是UITableViewCell重用机制的问题. 解决方法一:对在cell中添加的控件设置tag的方法 在cell的contentView上需要添加控件,那 ...

  10. C++动态时间显示

    #include <iostream> #include<stdlib.h> #include<windows.h> #include<string> ...