-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lecture05 Build own hive metastore docker image
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |