From 065dd2c36cf44533702ba9d84aa2847be45f4784 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Wed, 23 Dec 2020 18:42:29 +0500 Subject: [PATCH] Redirect output of docker commands to /dev/null and use mirrored docker image. --- .gitlab-ci.yml | 4 ++-- mirror.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5fcbf3a..c3b3677 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ -image: docker:19.03.13 +image: registry.gitlab.pztrn.name/containers/mirror/docker:19.03.13 services: - - docker:19.03.13-dind + - registry.gitlab.pztrn.name/containers/mirror/docker:19.03.13-dind variables: DOCKER_HOST: tcp://docker:2375 diff --git a/mirror.sh b/mirror.sh index 5a38f57..0e52d68 100755 --- a/mirror.sh +++ b/mirror.sh @@ -28,14 +28,14 @@ function mirror() { image_hash=$(docker images -a | grep "${image_name}" | grep "${image_version}" | awk {' print $3 '}) echo -n "${image_hash} received... " - docker tag "${image_hash}" "${REGISTRY_TO_MIRROR}/${image}" + docker tag "${image_hash}" "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null if [ $? -ne 0 ]; then echo "FAIL" exit fi echo -n "pushing... " - docker push "${REGISTRY_TO_MIRROR}/${image}" + docker push "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null if [ $? -ne 0 ]; then echo "FAIL" exit @@ -43,7 +43,7 @@ function mirror() { echo "OK" - docker image rm "${image}" + docker image rm "${image}" &> /dev/null } # Mirror images.