From bdb0412836ff03a783a2803306597cf059cfbce0 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sat, 14 Dec 2019 13:15:15 +0100 Subject: [PATCH] Actual TTY fix - don't run docker interactively --- registry-cleaner.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/registry-cleaner.sh b/registry-cleaner.sh index 210f8ed..5d533c9 100755 --- a/registry-cleaner.sh +++ b/registry-cleaner.sh @@ -12,14 +12,12 @@ DIRNAME=$(dirname $SCRIPT) # Soft delete untagged images. # ----------------------------------------------------------------------------- -if [ -t 1 ]; then - echo -e "${CYAN}[${SCRIPT}] Soft delete untagged images ${NC}" -fi +echo -e "${CYAN}[${SCRIPT}] Soft delete untagged images ${NC}" install="pip3 install gitlab-registry-cleanup" cleanup="gitlab-registry-cleanup -g https://gitlab.wojciechkozlowski.eu -r https://registry.wojciechkozlowski.eu -c /gitlab.cred" -docker run -it --rm --volumes-from gitlab \ +docker run --rm --volumes-from gitlab \ -v ${DIRNAME}/gitlab.cred:/gitlab.cred \ python bash -c "${install} && ${cleanup}" @@ -27,8 +25,6 @@ docker run -it --rm --volumes-from gitlab \ # Garbage collect and hard delete untagged images. # ----------------------------------------------------------------------------- -if [ -t 1 ]; then - echo -e "${CYAN}[${SCRIPT}] Garbage collect untagged images ${NC}" -fi +echo -e "${CYAN}[${SCRIPT}] Garbage collect untagged images ${NC}" docker exec gitlab bash -c "gitlab-ctl registry-garbage-collect"