multiarch!
All checks were successful
Build-Publish-Multi-Arch / build (linux/amd64) (push) Successful in 6m6s
Build-Publish-Multi-Arch / build (linux/arm64) (push) Successful in 6m33s
Build-Publish-Multi-Arch / create-manifest (push) Successful in 27s

This commit is contained in:
Your Name
2025-09-21 14:49:21 +12:00
parent 275b7bccfb
commit 1ef17c650d
4 changed files with 128 additions and 41 deletions

View File

@@ -3,22 +3,34 @@
set -euo pipefail
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ARCH=$(uname -m)
# get date/time in local timezone, format YYYY.MMDD.HHMMSS
DATETIME=$(date +%Y.%m%d.%H%M%S)
echo "Publishing generic-docker-images to gitea.jde.nz/public/<image_name>:latest-${ARCH}"
"${SCRIPTDIR}/build.sh"
function die() {
echo "error: $1"
exit 1
}
# iterate through the docker files in format Dockerfile.IMAGE_NAME
# Build all images
"${SCRIPTDIR}/build.sh" || die "Build failed"
# Iterate through the docker files in format Dockerfile.IMAGE_NAME
for dockerfile in Dockerfile.*
do
# get the image name from the dockerfile
# Get the image name from the dockerfile
image_name="${dockerfile//Dockerfile./}"
# tag the image with the latest tag
docker tag "$image_name:latest" "gitea.jde.nz/public/$image_name:latest"
docker tag "$image_name:latest" "gitea.jde.nz/public/$image_name:$DATETIME"
# push the image to the local docker registry
docker push -a "gitea.jde.nz/public/$image_name"
# Create and push the arch-specific docker image
IMAGE_NAME="gitea.jde.nz/public/${image_name}:latest-${ARCH}"
# Tag the locally built image with arch-specific tag
docker tag "${image_name}:latest" "${IMAGE_NAME}"
# Push the arch-specific image
docker push "${IMAGE_NAME}"
echo "Pushed ${IMAGE_NAME}"
done
echo "All architecture-specific images pushed successfully"