forked from apache/hive
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.rhel8
63 lines (48 loc) · 2.64 KB
/
Dockerfile.rhel8
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
FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.8 AS build
RUN yum -y install --setopt=skip_missing_names_on_install=False curl
RUN mkdir /build
COPY . /build
WORKDIR /build
COPY opt_maven_install.sh /tmp/
RUN chmod u+x /tmp/opt_maven_install.sh && /tmp/opt_maven_install.sh $OPENSHIFT_CI
FROM registry.ci.openshift.org/ocp/4.8:metering-hadoop
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 && \
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
COPY --from=build /build/mysql-connector-java.jar /usr/lib/java/mysql-java-connector.jar
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/lib/java/mysql-java-connector.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"
# Debug artifact for conflicting Guava JAR versioning
RUN find /opt/ -name '*guava-*.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]"