Merge pull request #7170 from wy65701436/gc-untagged

Enable docker registry to clean untagged revisions
This commit is contained in:
Wenkai Yin 2019-03-19 18:01:30 +08:00 committed by GitHub
commit 08c20c5ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ type GCResult struct {
// StartGC ... // StartGC ...
func StartGC(w http.ResponseWriter, r *http.Request) { func StartGC(w http.ResponseWriter, r *http.Request) {
cmd := exec.Command("/bin/bash", "-c", "registry garbage-collect "+regConf) cmd := exec.Command("/bin/bash", "-c", "registry garbage-collect --delete-untagged=true "+regConf)
var outBuf, errBuf bytes.Buffer var outBuf, errBuf bytes.Buffer
cmd.Stdout = &outBuf cmd.Stdout = &outBuf
cmd.Stderr = &errBuf cmd.Stderr = &errBuf