World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[MINOR] refactor(image): Fix Docker image build error (#532)
mchades999d7b3ef706
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.ymlindex 03938c1aa6..6d6fcb6bf8 100644--- a/.github/workflows/docker-image.yml+++ b/.github/workflows/docker-image.yml@@ -45,8 +45,8 @@ jobs:- name: Build and Push the main branch Docker imageif: ${{ github.ref_name == 'main' }}- run: ./dev/docker/hive/build-docker.sh --platform all --image ${HIVE_IMAGE_NAME}:${{ github.event.inputs.tag }} --tag ${HIVE_IMAGE_NAME}:latest+ run: ./dev/docker/hive/build-docker.sh --platform all --image ${HIVE_IMAGE_NAME} --tag ${{ github.event.inputs.tag }} --latest- name: Build and Push the other branch Docker imageif: ${{ github.ref_name != 'main' }}- run: ./dev/docker/hive/build-docker.sh --platform all --image ${HIVE_IMAGE_NAME}:${{ github.event.inputs.tag }}+ run: ./dev/docker/hive/build-docker.sh --platform all --image ${HIVE_IMAGE_NAME} --tag ${{ github.event.inputs.tag }}diff --git a/dev/docker/hive/README.md b/dev/docker/hive/README.mdindex 72ff30d9d1..d37958c350 100644--- a/dev/docker/hive/README.md+++ b/dev/docker/hive/README.md@@ -8,7 +8,7 @@ It includes Hadoop-2.x and Hive-2.x, you can use this Docker image to test the G## Build Docker image```-./build-docker.sh --platform [all|linux/amd64|linux/arm64] --image {image_name} --tag {tag_name}+./build-docker.sh --platform [all|linux/amd64|linux/arm64] --image {image_name} --tag {tag_name} --latest```## Run containerdiff --git a/dev/docker/hive/build-docker.sh b/dev/docker/hive/build-docker.shindex e251d219a3..d41d18091a 100755--- a/dev/docker/hive/build-docker.sh+++ b/dev/docker/hive/build-docker.sh@@ -10,7 +10,6 @@ bin="$(cd "${bin}">/dev/null; pwd)"# Environment variables definitionHADOOP_VERSION="2.7.3"HIVE_VERSION="2.3.9"-IMAGE_NAME="datastrato/gravitino-ci-hive:0.1.1"HADOOP_PACKAGE_NAME="hadoop-${HADOOP_VERSION}.tar.gz"HADOOP_DOWNLOAD_URL="http://archive.apache.org/dist/hadoop/core/hadoop-${HADOOP_VERSION}/${HADOOP_PACKAGE_NAME}"@@ -19,7 +18,7 @@ HIVE_PACKAGE_NAME="apache-hive-${HIVE_VERSION}-bin.tar.gz"HIVE_DOWNLOAD_URL="https://archive.apache.org/dist/hive/hive-${HIVE_VERSION}/${HIVE_PACKAGE_NAME}"# Build docker image for multi-arch-USAGE="-e Usage: ./build-docker.sh --platform [all|linux/amd64|linux/arm64] --image {image_name} --tag {tag_name}"+USAGE="-e Usage: ./build-docker.sh --platform [all|linux/amd64|linux/arm64] --image {image_name} --tag {tag_name} --latest"# Get platform typeif [[ "$1" == "--platform" ]]; then@@ -55,6 +54,13 @@ if [[ "$1" == "--tag" ]]; thenshiftfi+# Get latest flag+buildLatest=0+if [[ "$1" == "--latest" ]]; then+ shift+ buildLatest=1+fi+# Prepare download packagesif [[ ! -d "${bin}/packages" ]]; thenmkdir -p "${bin}/packages"@@ -80,14 +86,14 @@ ficd ${bin}if [[ "${platform_type}" == "all" ]]; then- if [[ "${tag_name}" == "" ]]; then- docker buildx build --platform=linux/amd64,linux/arm64 --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --push --progress plain -f Dockerfile -t ${image_name} .+ if [ ${buildLatest} -eq 1 ]; then+ docker buildx build --platform=linux/amd64,linux/arm64 --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --push --progress plain -f Dockerfile -t ${image_name}:latest -t ${image_name}:${tag_name} .else- docker buildx build --platform=linux/amd64,linux/arm64 --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --push --progress plain -f Dockerfile -t ${image_name}:${tag_name} .+ docker buildx build --platform=linux/amd64,linux/arm64 --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --push --progress plain -f Dockerfile -t ${image_name}:${tag_name} .fielse- if [[ "${tag_name}" == "" ]]; then- docker buildx build --platform=${platform_type} --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --output type=docker --progress plain -f Dockerfile -t ${image_name} .+ if [ ${buildLatest} -eq 1 ]; then+ docker buildx build --platform=${platform_type} --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --output type=docker --progress plain -f Dockerfile -t ${image_name}:latest -t ${image_name}:${tag_name} .elsedocker buildx build --platform=${platform_type} --build-arg HADOOP_PACKAGE_NAME=${HADOOP_PACKAGE_NAME} --build-arg HIVE_PACKAGE_NAME=${HIVE_PACKAGE_NAME} --output type=docker --progress plain -f Dockerfile -t ${image_name}:${tag_name} .fi