forked from kube-reporting/hive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.rhel
82 lines (61 loc) · 3.14 KB
/
Dockerfile.rhel
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM rhel7:7-released AS build
RUN yum -y update && yum clean all
RUN yum -y install --setopt=skip_missing_names_on_install=False \
curl \
&& yum clean all \
&& rm -rf /var/cache/yum
RUN mkdir /build
COPY . /build
WORKDIR /build
ENV RH_HIVE_PATCH_VERSION 00002
ENV HIVE_VERSION 2.3.3
ENV HIVE_RELEASE_URL http://download.eng.bos.redhat.com/brewroot/packages/org.apache.hive-hive/${HIVE_VERSION}.redhat_${RH_HIVE_PATCH_VERSION}/1/maven/org/apache/hive/hive-packaging/${HIVE_VERSION}.redhat-${RH_HIVE_PATCH_VERSION}/hive-packaging-${HIVE_VERSION}.redhat-${RH_HIVE_PATCH_VERSION}-bin.tar.gz
ENV HIVE_OUT /build/packaging/target/apache-hive-$HIVE_VERSION-bin/apache-hive-$HIVE_VERSION-bin
RUN curl -fSLs \
$HIVE_RELEASE_URL \
-o /tmp/hive-bin.tar.gz
RUN mkdir -p $(dirname $HIVE_OUT) && \
tar -xvf /tmp/hive-bin.tar.gz -C /tmp \
&& mv /tmp/apache-hive-${HIVE_VERSION}.redhat-${RH_HIVE_PATCH_VERSION}-bin/ \
$HIVE_OUT
FROM openshift/ose-metering-hadoop:latest
ENV HIVE_VERSION=2.3.3
ENV HIVE_HOME=/opt/hive
ENV PATH=$HIVE_HOME/bin:$PATH
RUN mkdir -p /opt
WORKDIR /opt
USER root
RUN yum -y update && \
yum install --setopt=skip_missing_names_on_install=False -y \
postgresql-jdbc \
openssl \
mysql-connector-java \
&& yum clean all \
&& rm -rf /var/cache/yum
COPY --from=build /build/packaging/target/apache-hive-$HIVE_VERSION-bin/apache-hive-$HIVE_VERSION-bin $HIVE_HOME
WORKDIR $HIVE_HOME
ENV HADOOP_CLASSPATH $HIVE_HOME/hcatalog/share/hcatalog/*:${HADOOP_CLASSPATH}
# Configure Hadoop AWS Jars to be available to hive
RUN ln -s ${HADOOP_HOME}/share/hadoop/tools/lib/*aws* $HIVE_HOME/lib
# Configure MySQL connector jar to be available to hive
RUN ln -s /usr/share/java/mysql-connector-java.jar "$HIVE_HOME/lib/mysql-connector-java.jar"
# Configure Postgesql connector jar to be available to hive
RUN ln -s /usr/share/java/postgresql-jdbc.jar "$HIVE_HOME/lib/postgresql-jdbc.jar"
# https://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
# Java caches dns results forever, don't cache dns results forever:
RUN sed -i '/networkaddress.cache.ttl/d' $JAVA_HOME/lib/security/java.security
RUN sed -i '/networkaddress.cache.negative.ttl/d' $JAVA_HOME/lib/security/java.security
RUN echo 'networkaddress.cache.ttl=0' >> $JAVA_HOME/lib/security/java.security
RUN echo 'networkaddress.cache.negative.ttl=0' >> $JAVA_HOME/lib/security/java.security
# imagebuilder expects the directory to be created before VOLUME
RUN mkdir -p /var/lib/hive /.beeline $HOME/.beeline
# to allow running as non-root
RUN chown -R 1002:0 $HIVE_HOME $HADOOP_HOME /var/lib/hive /.beeline $HOME/.beeline /etc/passwd $JAVA_HOME/lib/security/cacerts && \
chmod -R 774 $HIVE_HOME $HADOOP_HOME /var/lib/hive /.beeline $HOME/.beeline /etc/passwd $JAVA_HOME/lib/security/cacerts
VOLUME /var/lib/hive
USER 1002
LABEL io.k8s.display-name="OpenShift Hive" \
io.k8s.description="This is an image used by the Metering Operator to install and run Apache Hive." \
summary="This is an image used by the Metering Operator to install and run Apache Hive." \
io.openshift.tags="openshift" \
maintainer="[email protected]"