-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
32 lines (23 loc) · 1.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM openjdk:8-jre-slim-buster
WORKDIR /opt
ENV HADOOP_VERSION=3.2.0
ENV METASTORE_VERSION=3.0.0
RUN apt-get update && apt-get install -y netcat curl
ENV HADOOP_HOME=/opt/hadoop-${HADOOP_VERSION}
ENV HIVE_HOME=/opt/apache-hive-metastore-${METASTORE_VERSION}-bin
RUN curl -L https://downloads.apache.org/hive/hive-standalone-metastore-${METASTORE_VERSION}/hive-standalone-metastore-${METASTORE_VERSION}-bin.tar.gz | tar zxf - && \
curl -L https://archive.apache.org/dist/hadoop/common/hadoop-${HADOOP_VERSION}/hadoop-${HADOOP_VERSION}.tar.gz | tar zxf - && \
curl -L https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.19.tar.gz | tar zxf - && \
curl -L --output postgresql-42.4.0.jar https://jdbc.postgresql.org/download/postgresql-42.4.0.jar && \
cp mysql-connector-java-8.0.19/mysql-connector-java-8.0.19.jar ${HIVE_HOME}/lib/ && \
cp postgresql-42.4.0.jar ${HIVE_HOME}/lib/ && \
rm -rf mysql-connector-java-8.0.19 && \
rm -rf postgresql-42.4.0.jar
COPY scripts/entrypoint.sh /entrypoint.sh
RUN groupadd -r hive --gid=1000 && \
useradd -r -g hive --uid=1000 -d ${HIVE_HOME} hive && \
chown hive:hive -R ${HIVE_HOME} && \
chown hive:hive /entrypoint.sh && chmod +x /entrypoint.sh
USER hive
EXPOSE 9083
ENTRYPOINT ["sh", "-c", "/entrypoint.sh"]