From 5a6ffb5bd6d16d0178d8a5fd593c23395bfb4768 Mon Sep 17 00:00:00 2001 From: Kasper Svane Date: Tue, 27 Aug 2024 19:36:37 +0200 Subject: [PATCH] lecture05 Build own hive metastore docker image --- services/hive-metastore/Dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 services/hive-metastore/Dockerfile diff --git a/services/hive-metastore/Dockerfile b/services/hive-metastore/Dockerfile new file mode 100644 index 0000000..37841ee --- /dev/null +++ b/services/hive-metastore/Dockerfile @@ -0,0 +1,26 @@ +# Use an official openjdk runtime as a parent image +FROM openjdk:8-jdk + +# Set environment variables +ENV HIVE_VERSION=3.1.2 +ENV JAVA_HOME=/usr/local/openjdk-8 +ENV HIVE_HOME=/opt/hive-${HIVE_VERSION} + +# Install dependencies +RUN apt-get update && apt-get install -y wget tar procps + +# Download and install Hive +RUN wget https://downloads.apache.org/hive/hive-${HIVE_VERSION}/apache-hive-${HIVE_VERSION}-bin.tar.gz && \ + tar -xzvf apache-hive-${HIVE_VERSION}-bin.tar.gz -C /opt && \ + mv /opt/apache-hive-${HIVE_VERSION}-bin /opt/hive-${HIVE_VERSION} && \ + rm apache-hive-${HIVE_VERSION}-bin.tar.gz + +# Set up Hive environment variables +ENV PATH=$PATH:${HIVE_HOME}/bin + +# Expose the Thrift port +EXPOSE 9083 + +# Entry point for starting the Hive Metastore +ENTRYPOINT ["hive", "metastore"] +CMD ["-p", "9083"]