36 lines
911 B
Bash
Executable File
36 lines
911 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
ARCH=$(uname -m)
|
|
|
|
echo "Publishing generic-docker-images to gitea.jde.nz/public/<image_name>:latest-${ARCH}"
|
|
|
|
function die() {
|
|
echo "error: $1"
|
|
exit 1
|
|
}
|
|
|
|
# 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
|
|
image_name="${dockerfile//Dockerfile./}"
|
|
|
|
# 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" |