This commit is contained in:
parent
65c4f0b4db
commit
6af5138b90
@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
echo "golang:1.15.5-alpine golang:1.17.1-alpine"
|
echo "golang:1.18.3-alpine"
|
||||||
|
10
mirror.sh
10
mirror.sh
@ -23,7 +23,7 @@ function mirror() {
|
|||||||
image_version=$(echo "${image}" | cut -d":" -f 2)
|
image_version=$(echo "${image}" | cut -d":" -f 2)
|
||||||
|
|
||||||
echo -n "Mirroring ${image}... "
|
echo -n "Mirroring ${image}... "
|
||||||
if ! docker pull "${image}"; then
|
if ! docker pull "${image}" &>/dev/null; then
|
||||||
echo "PULL FAILED"
|
echo "PULL FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -32,21 +32,21 @@ 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... "
|
||||||
|
|
||||||
if ! docker tag "${image_hash}" "${DESTINATION_REGISTRY}/${image}"; then
|
if ! docker tag "${image_hash}" "${DESTINATION_REGISTRY}/${image}" &>/dev/null; then
|
||||||
echo "TAGGING FAILED"
|
echo "TAGGING FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n "pushing... "
|
echo -n "pushing... "
|
||||||
if ! docker push "${DESTINATION_REGISTRY}/${image}"; then
|
if ! docker push "${DESTINATION_REGISTRY}/${image}" &>/dev/null; then
|
||||||
echo "FAILED"
|
echo "FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
docker image rm "${image}"
|
docker image rm "${image}" &>/dev/null
|
||||||
docker image rm "${DESTINATION_REGISTRY}/${image}"
|
docker image rm "${DESTINATION_REGISTRY}/${image}" &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Login to registry.
|
# Login to registry.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user