build arm image
This commit is contained in:
@ -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
BIN
packages/reservation-platform/docker/myp-rp_latest.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user