Add alpine:3.16.0 for mirrorring and add ability to check if image mirrorred.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
3f26589e85
commit
e0b6a10931
2
images/alpine.sh
Normal file
2
images/alpine.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
echo "alpine:3.16.0"
|
15
mirror.sh
15
mirror.sh
@ -51,9 +51,15 @@ function get_amd64_image() {
|
|||||||
image_name=$(echo "${image}" | cut -d":" -f 1)
|
image_name=$(echo "${image}" | cut -d":" -f 1)
|
||||||
image_version=$(echo "${image}" | cut -d":" -f 2)
|
image_version=$(echo "${image}" | cut -d":" -f 2)
|
||||||
|
|
||||||
|
# Check if amd64 layers should be fetched.
|
||||||
|
if docker manifest inspect "${REMOTE_IMAGE}-amd64" &> /dev/null; then
|
||||||
|
echo -e "\t* Layers for amd64 architecture for this image exist."
|
||||||
|
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
echo -ne "\t* Getting amd64 layers... "
|
echo -ne "\t* Getting amd64 layers... "
|
||||||
|
|
||||||
# arm64 layers might be missing. So we just put "FAIL!" here and do nothing else.
|
|
||||||
if ! docker pull --platform=linux/amd64 "${image}" &> /dev/null; then
|
if ! docker pull --platform=linux/amd64 "${image}" &> /dev/null; then
|
||||||
echo "FAIL!"
|
echo "FAIL!"
|
||||||
|
|
||||||
@ -79,6 +85,13 @@ function get_arm64_image() {
|
|||||||
image_name=$(echo "${image}" | cut -d":" -f 1)
|
image_name=$(echo "${image}" | cut -d":" -f 1)
|
||||||
image_version=$(echo "${image}" | cut -d":" -f 2)
|
image_version=$(echo "${image}" | cut -d":" -f 2)
|
||||||
|
|
||||||
|
# Check if arm64 layers should be fetched.
|
||||||
|
if docker manifest inspect "${REMOTE_IMAGE}-arm64" &> /dev/null; then
|
||||||
|
echo -e "\t* Layers for arm64 architecture for this image exist."
|
||||||
|
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
echo -ne "\t* Getting arm64 layers... "
|
echo -ne "\t* Getting arm64 layers... "
|
||||||
|
|
||||||
# arm64 layers might be missing. So we just put "FAIL!" here and do nothing else.
|
# arm64 layers might be missing. So we just put "FAIL!" here and do nothing else.
|
||||||
|
Loading…
Reference in New Issue
Block a user