add source code and readme
This commit is contained in:
41
build/postgresql-postgis/build.sh
Executable file
41
build/postgresql-postgis/build.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Build script for ARM64 PostGIS image compatible with CloudNativePG
|
||||
|
||||
REGISTRY="<YOUR_REGISTRY_URL>/library"
|
||||
IMAGE_NAME="cnpg-postgis"
|
||||
TAG="16.6-3.4-v2"
|
||||
FULL_IMAGE="${REGISTRY}/${IMAGE_NAME}:${TAG}"
|
||||
LOCAL_IMAGE="${IMAGE_NAME}:${TAG}"
|
||||
|
||||
echo "Building ARM64 PostGIS image: ${FULL_IMAGE}"
|
||||
|
||||
# Build the image
|
||||
docker build \
|
||||
--platform linux/arm64 \
|
||||
-t "${FULL_IMAGE}" \
|
||||
.
|
||||
|
||||
echo "Image built successfully: ${FULL_IMAGE}"
|
||||
|
||||
# Test the image by running a container and checking PostGIS availability
|
||||
echo "Testing PostGIS installation..."
|
||||
docker run --rm --platform linux/arm64 "${FULL_IMAGE}" \
|
||||
postgres --version
|
||||
|
||||
echo "Tagging image for local testing..."
|
||||
docker tag "${FULL_IMAGE}" "${LOCAL_IMAGE}"
|
||||
|
||||
echo "Image built and tagged as:"
|
||||
echo " Harbor registry: ${FULL_IMAGE}"
|
||||
echo " Local testing: ${LOCAL_IMAGE}"
|
||||
|
||||
echo ""
|
||||
echo "To push to Harbor registry (when ready for deployment):"
|
||||
echo " docker push ${FULL_IMAGE}"
|
||||
|
||||
echo ""
|
||||
echo "Build completed successfully!"
|
||||
echo "Local testing image: ${LOCAL_IMAGE}"
|
||||
echo "Harbor registry image: ${FULL_IMAGE}"
|
||||
Reference in New Issue
Block a user