cd1989 / harbor-cleaner Goto Github PK
View Code? Open in Web Editor NEWClean images in Harbor by policies
License: Apache License 2.0
Clean images in Harbor by policies
License: Apache License 2.0
For the moment, if some tags share a same image manifests, they will be bind together, we can't delete some of them and to retain others.
If t1
, t2
, t3
, t4
refer to the same image and we want to delete tags t1
, t2
. Then we can:
t1
(so all 4 tags will be deleted)t3
, t4
back by pushing the manifest, since blobs already in registry, no need to push blobs.Support deletion policy: Delete all tags that have not been used for a given time period.
For Harbor 1.9+ versions, you may encounter this problem:
ERRO[0000] login harbor: http://10.73.48.46 error: code 403, body:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>beego application error</title>
<style>
html, body, body * {padding: 0; margin: 0;}
#header {background:#ffd; border-bottom:solid 2px #A31515; padding: 20px 10px;}
#header h2{ }
#footer {border-top:solid 1px #aaa; padding: 5px 10px; font-size: 12px; color:green;}
#content {padding: 5px;}
#content .stack b{ font-size: 13px; color: red;}
#content .stack pre{padding-left: 10px;}
table {}
td.t {text-align: right; padding-right: 5px; color: #888;}
</style>
<script type="text/javascript">
</script>
</head>
<body>
<div id="header">
<h2>Harbor:'_xsrf' argument missing from POST</h2>
</div>
<div id="content">
<table>
<tr>
<td class="t">Request Method: </td><td>POST</td>
</tr>
<tr>
<td class="t">Request URL: </td><td>/c/login?principal=admin&password=Pwd123456</td>
</tr>
<tr>
<td class="t">RemoteAddr: </td><td>172.22.0.1</td>
</tr>
</table>
<div class="stack">
<b>Stack</b>
<pre>/usr/local/go/src/runtime/panic.go:522
/harbor/src/vendor/github.com/astaxie/beego/context/context.go:80
/harbor/src/vendor/github.com/astaxie/beego/context/context.go:164
/harbor/src/vendor/github.com/astaxie/beego/controller.go:649
/harbor/src/vendor/github.com/astaxie/beego/router.go:788
/usr/local/go/src/net/http/server.go:2774
/usr/local/go/src/net/http/server.go:1878
/usr/local/go/src/runtime/asm_amd64.s:1337
</pre>
</div>
</div>
<div id="footer">
<p>beego 1.9.0 (beego framework)</p>
<p>golang version: go1.12.12</p>
</div>
</body>
</html>
A workaround is to disable XSRF check in Harbor.
./common/config/core/app.conf
to set EnableXSRF
to false
docker restart harbor-core
For images that have no tags, even GC can't release the storage.
Untagged images will be generated when push images with same tag to override a old one.
Support trigger the cleanup policies regularly. For example, by cron
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.