Redirect output of docker commands to /dev/null and use mirrored docker image.
This commit is contained in:
parent
41a58410f6
commit
065dd2c36c
@ -1,7 +1,7 @@
|
|||||||
image: docker:19.03.13
|
image: registry.gitlab.pztrn.name/containers/mirror/docker:19.03.13
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker:19.03.13-dind
|
- registry.gitlab.pztrn.name/containers/mirror/docker:19.03.13-dind
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
|
@ -28,14 +28,14 @@ function mirror() {
|
|||||||
image_hash=$(docker images -a | grep "${image_name}" | grep "${image_version}" | awk {' print $3 '})
|
image_hash=$(docker images -a | grep "${image_name}" | grep "${image_version}" | awk {' print $3 '})
|
||||||
echo -n "${image_hash} received... "
|
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
|
if [ $? -ne 0 ]; then
|
||||||
echo "FAIL"
|
echo "FAIL"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "pushing... "
|
echo -n "pushing... "
|
||||||
docker push "${REGISTRY_TO_MIRROR}/${image}"
|
docker push "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "FAIL"
|
echo "FAIL"
|
||||||
exit
|
exit
|
||||||
@ -43,7 +43,7 @@ function mirror() {
|
|||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
docker image rm "${image}"
|
docker image rm "${image}" &> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mirror images.
|
# Mirror images.
|
||||||
|
Loading…
Reference in New Issue
Block a user