|
13 | 13 |
|
14 | 14 | # syntax=docker/dockerfile:1 |
15 | 15 | ARG TRINO_GATEWAY_BASE_IMAGE |
16 | | -FROM ${TRINO_GATEWAY_BASE_IMAGE} AS jdk-download |
| 16 | +ARG TRINO_GATEWAY_BUILD_IMAGE |
| 17 | + |
| 18 | +FROM ${TRINO_GATEWAY_BUILD_IMAGE} AS jdk-download |
17 | 19 | ARG JDK_DOWNLOAD_LINK |
18 | 20 | ARG JDK_RELEASE_NAME |
19 | 21 | ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_RELEASE_NAME}" |
20 | 22 |
|
21 | 23 | RUN \ |
22 | 24 | set -xeuo pipefail && \ |
23 | | - microdnf install -y tar gzip && \ |
| 25 | + dnf install -y tar gzip && \ |
24 | 26 | # Install JDK from the provided archive link \ |
25 | 27 | echo "Downloading JDK from ${JDK_DOWNLOAD_LINK}" && \ |
26 | 28 | mkdir -p "${JAVA_HOME}" && \ |
27 | 29 | curl -#LfS "${JDK_DOWNLOAD_LINK}" | tar -zx --strip 1 -C "${JAVA_HOME}" |
28 | 30 |
|
| 31 | +FROM ${TRINO_GATEWAY_BUILD_IMAGE} AS packages |
| 32 | + |
| 33 | +RUN \ |
| 34 | + set -xeuo pipefail && \ |
| 35 | + mkdir -p /tmp/overlay/usr/libexec/ && \ |
| 36 | + touch /tmp/overlay/usr/libexec/grepconf.sh && \ |
| 37 | + chmod +x /tmp/overlay/usr/libexec/grepconf.sh && \ |
| 38 | + dnf update -y && \ |
| 39 | + dnf install --installroot /tmp/overlay --setopt install_weak_deps=false --nodocs -y \ |
| 40 | + less \ |
| 41 | + zlib `#required by java` \ |
| 42 | + shadow-utils `# required by useradd` \ |
| 43 | + tar `# required to support kubectl cp` && \ |
| 44 | + rm -rf /tmp/overlay/var/cache/* |
| 45 | + |
29 | 46 | FROM ${TRINO_GATEWAY_BASE_IMAGE} |
30 | 47 | WORKDIR /usr/lib/trino-gateway |
31 | 48 |
|
32 | 49 | ARG JDK_RELEASE_NAME |
33 | 50 | ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_RELEASE_NAME}" |
34 | 51 | ENV PATH=$PATH:$JAVA_HOME/bin |
35 | 52 | COPY --from=jdk-download $JAVA_HOME $JAVA_HOME |
| 53 | +COPY --from=packages /tmp/overlay / |
36 | 54 |
|
37 | 55 | RUN \ |
38 | 56 | set -xeu && \ |
39 | | - microdnf update -y && \ |
40 | | - microdnf install -y tar less shadow-utils && \ |
41 | 57 | groupadd trino --gid 1000 && \ |
42 | 58 | useradd trino --uid 1000 --gid 1000 --create-home && \ |
43 | 59 | mkdir -p /usr/lib/trino-gateway /etc/trino-gateway && \ |
|
0 commit comments