Initial commit
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# Build script for Alpine Linux base image
|
||||
# Supports multi-arch: ARM64 (aarch64) and x86_64
|
||||
|
||||
set -e
|
||||
|
||||
ARCH="${ARCH:-$(uname -m)}"
|
||||
ALPINE_VERSION="${ALPINE_VERSION:-3.19}"
|
||||
IMAGE_NAME="archipelago/alpine-base"
|
||||
TAG="${ALPINE_VERSION}-${ARCH}"
|
||||
|
||||
echo "🔨 Building Alpine Linux base image for ${ARCH}..."
|
||||
|
||||
# Map architecture names
|
||||
case "$ARCH" in
|
||||
aarch64|arm64)
|
||||
BUILD_ARCH="arm64"
|
||||
PLATFORM="linux/arm64"
|
||||
;;
|
||||
x86_64|amd64)
|
||||
BUILD_ARCH="amd64"
|
||||
PLATFORM="linux/amd64"
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Build the image
|
||||
docker buildx build \
|
||||
--platform "$PLATFORM" \
|
||||
--file image-recipe/Dockerfile.alpine-base \
|
||||
--tag "${IMAGE_NAME}:${TAG}" \
|
||||
--tag "${IMAGE_NAME}:latest-${BUILD_ARCH}" \
|
||||
--load \
|
||||
.
|
||||
|
||||
echo "✅ Alpine base image built successfully!"
|
||||
echo " Image: ${IMAGE_NAME}:${TAG}"
|
||||
echo " Platform: ${PLATFORM}"
|
||||
Reference in New Issue
Block a user