forked from trinodb/trino
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.rhel
67 lines (51 loc) · 2.62 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
FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.8 AS build
RUN mkdir /build
COPY . /build
RUN mkdir -p /build /build/presto-server/target /build/presto-cli/target
COPY opt_maven_install.sh /tmp/
RUN chmod u+x /tmp/opt_maven_install.sh && /tmp/opt_maven_install.sh $OPENSHIFT_CI
# Debug check for jmx_prometheus_javaagent missing from the /build/ path
RUN ls /build/jmx_prometheus_javaagent.jar
FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.8
RUN set -x; \
INSTALL_PKGS="openssl java-1.8.0-openjdk java-1.8.0-openjdk-devel less rsync tini faq python3" \
&& yum install --setopt=skip_missing_names_on_install=False -y $INSTALL_PKGS \
&& yum clean all \
&& rm -rf /var/cache/yum
RUN alternatives --set python /usr/bin/python3
RUN python --version
RUN mkdir -p /opt/presto
ENV PRESTO_VERSION 328.0
ENV PRESTO_HOME /opt/presto/presto-server
ENV PRESTO_CLI /opt/presto/presto-cli
# Note: podman was having difficulties evaluating the PRESTO_VERSION
# environment variables: https://github.com/containers/libpod/issues/4878
ARG PRESTO_VERSION=${PRESTO_VERSION}
ENV PROMETHEUS_JMX_EXPORTER /opt/jmx_exporter/jmx_exporter.jar
ENV TERM linux
ENV HOME /opt/presto
ENV JAVA_HOME=/etc/alternatives/jre
RUN mkdir -p $PRESTO_HOME
# 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
COPY --from=build /build/presto-server/target/presto-server-${PRESTO_VERSION} ${PRESTO_HOME}
COPY --from=build /build/presto-cli/target/presto-cli-${PRESTO_VERSION}-executable.jar ${PRESTO_CLI}
COPY --from=build /build/jmx_prometheus_javaagent.jar ${PROMETHEUS_JMX_EXPORTER}
RUN ln $PRESTO_CLI /usr/local/bin/presto-cli && \
chmod 755 /usr/local/bin/presto-cli
RUN chown -R 1003:0 /opt/presto $JAVA_HOME/lib/security/cacerts && \
chmod -R 774 $JAVA_HOME/lib/security/cacerts && \
chmod -R 775 /opt/presto
USER 1003
EXPOSE 8080
WORKDIR $PRESTO_HOME
CMD ["tini", "--", "bin/launcher", "run"]
LABEL io.k8s.display-name="OpenShift Presto" \
io.k8s.description="This is an image used by the Metering Operator to install and run Presto." \
summary="This is an image used by the Metering Operator to install and run Presto." \
io.openshift.tags="openshift" \
maintainer="<[email protected]>"