|
8 | 8 | FROM stackable/image/java-devel AS builder
|
9 | 9 |
|
10 | 10 | ARG PRODUCT
|
| 11 | +ARG DELETE_CACHES="true" |
11 | 12 |
|
12 | 13 | USER stackable
|
13 | 14 | WORKDIR /stackable
|
14 | 15 |
|
15 |
| -RUN curl --fail -L https://dist.apache.org/repos/dist/release/phoenix/phoenix-omid-${PRODUCT}/phoenix-omid-${PRODUCT}-src.tar.gz | tar -xzC . |
| 16 | +# hadolint ignore=DL3003 |
| 17 | +RUN --mount=type=cache,id=maven,uid=1000,target=/stackable/.m2/repository <<EOF |
| 18 | + curl --fail -L https://dist.apache.org/repos/dist/release/phoenix/phoenix-omid-${PRODUCT}/phoenix-omid-${PRODUCT}-src.tar.gz | tar -xzC . |
| 19 | + cd /stackable/phoenix-omid-${PRODUCT} || exit |
| 20 | + mvn package -Phbase-2 -DskipTests |
| 21 | + tar -xf tso-server/target/omid-tso-server-${PRODUCT}-bin.tar.gz -C /stackable |
| 22 | + tar -xf examples/target/omid-examples-${PRODUCT}-bin.tar.gz -C /stackable |
16 | 23 |
|
17 |
| -WORKDIR /stackable/phoenix-omid-${PRODUCT} |
18 |
| -RUN mvn package -Phbase-2 -DskipTests && \ |
19 |
| - tar -xf tso-server/target/omid-tso-server-${PRODUCT}-bin.tar.gz -C /stackable && \ |
20 |
| - tar -xf examples/target/omid-examples-${PRODUCT}-bin.tar.gz -C /stackable |
| 24 | +if [ "${DELETE_CACHES}" = "true" ] ; then |
| 25 | + rm -rf /stackable/.m2/repository/* |
| 26 | +fi |
| 27 | +EOF |
21 | 28 |
|
22 | 29 | # ===
|
23 | 30 | # For earlier versions this script removes the .class file that contains the
|
@@ -51,29 +58,37 @@ LABEL name="Apache Phoenix Omid" \
|
51 | 58 | summary="The Stackable image for Apache Phoenix Omid." \
|
52 | 59 | description="This image is deployed by the Stackable Operator for Apache HBase."
|
53 | 60 |
|
54 |
| -RUN microdnf update && \ |
55 |
| - microdnf clean all && \ |
56 |
| - rm -rf /var/cache/yum |
57 |
| - |
58 |
| -ENV HOME=/stackable |
59 |
| - |
60 |
| -COPY --chown=stackable:stackable omid/stackable /stackable |
61 | 61 | COPY omid/licenses /licenses
|
62 | 62 |
|
63 |
| -USER stackable |
64 |
| -WORKDIR /stackable |
65 |
| - |
66 |
| -COPY --from=builder /stackable/omid-tso-server-${PRODUCT} /stackable/omid-tso-server-${PRODUCT} |
67 |
| -COPY --from=builder /stackable/omid-examples-${PRODUCT} /stackable/omid-examples-${PRODUCT} |
68 |
| - |
69 |
| -RUN ln -s /stackable/omid-tso-server-${PRODUCT} /stackable/omid-tso-server && \ |
70 |
| - ln -s /stackable/omid-examples-${PRODUCT} /stackable/omid-examples && \ |
71 |
| - curl https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar \ |
72 |
| - -o /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar && \ |
73 |
| - chmod -x /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar |
| 63 | +COPY --chown=stackable:stackable omid/stackable /stackable |
| 64 | +COPY --chown=stackable:stackable --from=builder /stackable/omid-tso-server-${PRODUCT} /stackable/omid-tso-server-${PRODUCT} |
| 65 | +COPY --chown=stackable:stackable --from=builder /stackable/omid-examples-${PRODUCT} /stackable/omid-examples-${PRODUCT} |
| 66 | + |
| 67 | +RUN <<EOF |
| 68 | + microdnf update |
| 69 | + microdnf clean all |
| 70 | + rm -rf /var/cache/yum |
| 71 | + |
| 72 | + ln -s /stackable/omid-tso-server-${PRODUCT} /stackable/omid-tso-server |
| 73 | + ln -s /stackable/omid-examples-${PRODUCT} /stackable/omid-examples |
| 74 | + curl https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar \ |
| 75 | + -o /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar |
| 76 | + chmod -x /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar |
| 77 | + # omid.sh places this file at the front of the classpath: remove it to allow the config map entry to take precedence |
| 78 | + rm /stackable/omid-tso-server/conf/hbase-site.xml |
| 79 | + |
| 80 | + # To support arbitrary user ids on OpenShift, this folder must belong to the root group. |
| 81 | + mkdir /stackable/logs |
| 82 | + chown -R 1000:0 /stackable/logs |
| 83 | + chgrp -R 0 /stackable/logs |
| 84 | + chmod -R g=u /stackable/logs |
| 85 | +EOF |
| 86 | + |
| 87 | +USER 1000 |
| 88 | +WORKDIR /stackable/omid-tso-server |
74 | 89 |
|
| 90 | +ENV HOME=/stackable |
75 | 91 | ENV HBASE_CONF_DIR=/stackable/hbase/conf
|
76 |
| -# omid.sh places this file at the front of the classpath: remove it to allow the config map entry to take precedence |
77 |
| -RUN rm /stackable/omid-tso-server/conf/hbase-site.xml |
78 |
| -WORKDIR /stackable/omid-tso-server |
| 92 | +ENV OMID_OPTS="-Domid.log.dir=/stackable/logs" |
| 93 | + |
79 | 94 | CMD ["./bin/omid.sh", "tso" ]
|
0 commit comments