(Go: >> BACK << -|- >> HOME <<)

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Being able to remove (empty) repositories with button #236

Closed
Yamakasi opened this issue Mar 10, 2022 · 5 comments
Closed

Being able to remove (empty) repositories with button #236

Yamakasi opened this issue Mar 10, 2022 · 5 comments
Labels
Related to Docker Registry Issues related to docker registry and not the UI wontfix

Comments

@Yamakasi
Copy link

Is your feature request related to a problem? Please describe.
I would like to be able to remove an (empty) repository like I can remove an image... I guess the garbage collector would do the rest ?

Describe the solution you'd like
Have a delete button to remove an empty repository

Describe alternatives you've considered
All kinds of scripts to remove empty repositories but I'm not able find any, they still exit (in this UI)

Additional context
I know this has been discussed a lot and it's not directly a docker-registry-ui issue but as there is a button to "delete" images it would be great to have the same for repositories... unless someone knows a way how to remove empty repo's with a script.

@Duvel
Copy link
Duvel commented Mar 14, 2022

+1

@mr-dxdy
Copy link
mr-dxdy commented Mar 29, 2022

The solution of problem is here

@Joxit Joxit added wontfix Related to Docker Registry Issues related to docker registry and not the UI labels Apr 18, 2022
@Joxit
Copy link
Owner
Joxit commented Apr 18, 2022

Hi there and thank you for using my project.

This is related to the docker registry server, I cannot remove empty images from the ui 😕 see #77

@Joxit Joxit closed this as completed Apr 18, 2022
@mrmillers
Copy link

A very ad-hoc way to automate garbage collection by customizing registry image if you are still interested:

Dockerfile:

FROM registry:2

RUN apk --no-cache add findutils && \
    rm -rf /var/cache/apk/*

COPY entrypoint.sh /entrypoint.sh
COPY cleanup.sh /cleanup.sh
RUN chmod +x /*.sh
ENTRYPOINT [ "/entrypoint.sh" ]

entrypoint.sh:

#!/bin/sh

# cleanup: remember to enable init for docker run and docker-compose
(
    while true; do
        sleep 600
        /cleanup.sh
    done
) &

exec registry serve /etc/docker/registry/config.yml

cleanup.sh:

#!/bin/sh

registry garbage-collect /etc/docker/registry/config.yml -m
find /var/lib/registry -empty -type d -delete
for d in /var/lib/registry/docker/registry/v2/repositories/*; do
    echo "Processing $d"
    if [ ! -d $d/_manifests ]; then
        echo "Will delete $d"
        rm -rf $d
    fi
done

@radziejewicz
Copy link

#!/bin/sh

registry garbage-collect /etc/docker/registry/config.yml -m
find /var/lib/registry -empty -type d -delete
for d in /var/lib/registry/docker/registry/v2/repositories/*; do
echo "Processing $d"
if [ ! -d $d/_manifests ]; then
echo "Will delete $d"
rm -rf $d
fi
done

Thanks @mrmillers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Related to Docker Registry Issues related to docker registry and not the UI wontfix
Projects
None yet
Development

No branches or pull requests

6 participants