Actual TTY fix - don't run docker interactively

This commit is contained in:
Wojciech Kozlowski 2019-12-14 13:15:15 +01:00
parent 7b71fe70cc
commit bdb0412836

View File

@ -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"