add build scripts and build container
This commit is contained in:
@@ -7,12 +7,28 @@ IMAGE_TAG="latest"
|
||||
# Specify the output file name
|
||||
OUTPUT_FILE="myp-rp_latest.tar.xz"
|
||||
|
||||
# Save the Docker image and compress it with xz
|
||||
docker save ${IMAGE_NAME}:${IMAGE_TAG} | xz -z -T0 > ./${OUTPUT_FILE}
|
||||
# Build the Docker image from Containerfile
|
||||
echo "Building Docker image from Containerfile..."
|
||||
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} -f $PWD/Containerfile $PWD
|
||||
|
||||
# Check if the operation was successful
|
||||
# Check if the build was successful
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error occurred while building the Docker image"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Docker image built successfully"
|
||||
|
||||
# Save the Docker image and compress it with xz
|
||||
echo "Saving and compressing the Docker image..."
|
||||
docker save ${IMAGE_NAME}:${IMAGE_TAG} | xz -z -T0 > $PWD/docker/${OUTPUT_FILE}
|
||||
|
||||
# Check if the save operation was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Image successfully saved and compressed to ${OUTPUT_FILE}"
|
||||
else
|
||||
echo "Error occurred while saving and compressing the image"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Process completed successfully"
|
||||
|
||||
Reference in New Issue
Block a user