build arm image

This commit is contained in:
Torben Haack
2024-10-10 11:50:15 +02:00
parent b0e2e8b16c
commit 4b4e773686
10 changed files with 1070 additions and 747 deletions

View File

@ -4,14 +4,38 @@
IMAGE_NAME="myp-rp"
IMAGE_TAG="latest"
# Build the Docker image from Containerfile
echo "Building Docker image from Containerfile..."
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} -f $PWD/Containerfile $PWD
# Create a new builder instance with a sensible name
BUILDER_NAME="myp-rp-arm64-builder"
echo "Creating a new builder instance named $BUILDER_NAME..."
docker buildx create --name $BUILDER_NAME --use
# Build the Docker image from Containerfile for arm64
echo "Building Docker image from Containerfile for arm64..."
docker buildx build --platform linux/arm64 -t ${IMAGE_NAME}:${IMAGE_TAG} -f $PWD/Containerfile $PWD --output type=docker,dest=docker/${IMAGE_NAME}_${IMAGE_TAG}.tar
# Check if the build was successful
if [ $? -ne 0 ]; then
echo "Error occurred while building the Docker image"
docker buildx rm $BUILDER_NAME
exit 1
fi
echo "Docker image built successfully"
# Compress the tar file using xz
echo "Compressing the image to docker/${IMAGE_NAME}_${IMAGE_TAG}.tar.xz..."
xz -z docker/${IMAGE_NAME}_${IMAGE_TAG}.tar
# Check if the compression was successful
if [ $? -ne 0 ]; then
echo "Error occurred while compressing the Docker image"
docker buildx rm $BUILDER_NAME
exit 1
fi
echo "Docker image compressed successfully as docker/${IMAGE_NAME}_${IMAGE_TAG}.tar.xz"
# Remove the builder instance
docker buildx rm $BUILDER_NAME
echo "Build process completed"

BIN
packages/reservation-platform/docker/myp-rp_latest.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.