This tool is used to delete images in gitlab registry
Download binary file in releases tab.
This is an example shell script to install. (Please change the file name and version)
#!/bin/sh
workDir=$(pwd)
gitlabRegistryControllerFile="${workDir}/gitlabRegistryController"
if [ ! -s "${gitlabRegistryControllerFile}" ]; then
curl --request GET -sL \
--url 'https://github.com/vleedev/gitlabRegistryController/releases/download/0.4.9/gitlabRegistryController-linux-amd64'\
--output "${gitlabRegistryControllerFile}"
fi
chmod +x "${gitlabRegistryControllerFile}"
./gitlabRegistryController -h
-domain string- a base url of your gitlab with api version, ex: https://gitlab.example.com/api/v4
- If not set, take
CI_API_V4_URLenv automatically.
-authToken string- a token that is used to auth with gitlab
- If not set, take
AUTH_TOKENenv automatically.
-nameSpace string- a namespace of your project
- If not set, take
CI_PROJECT_NAMESPACEenv automatically.
-projectName string- a project name of your project
- If not set, take
CI_PROJECT_NAMEenv automatically.
-specificTag string- a image tag that you want to delete
-regex string- a regex pattern to match all images
-hold int- a volume of images that you want to keep from latest to older (default 3)
./gitlabRegistryController -specificTag nginx-latest
-
Default: keep 3 images from latest to older
./gitlabRegistryController -regex=".*-nginx"
-
Keep n images from latest to older
./gitlabRegistryController -regex=".*-nginx" -hold=n