diff --git a/Dockerfile b/Dockerfile index b906986..bf1d950 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,13 +11,24 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM prestosql/presto:347 ARG PRESTO_VERSION +FROM debian:buster-slim AS builder +ARG PRESTO_VERSION + +RUN apt update && \ + apt -y install wget unzip + +RUN wget -c https://github.com/IBM/presto-db2/releases/download/${PRESTO_VERSION}/presto-db2-${PRESTO_VERSION}.zip +RUN unzip presto-db2-$PRESTO_VERSION.zip && rm -f presto-db2-$PRESTO_VERSION.zip + + +FROM prestosql/presto:$PRESTO_VERSION + USER root # Update centos packages -RUN dnf update -y +# RUN dnf upgrade -y && dnf autoremove USER presto:presto # Add Db2 connector -COPY --chown=presto:presto presto-db2-${PRESTO_VERSION} /usr/lib/presto/plugin/db2 +COPY --from=builder --chown=presto:presto presto-db2-* /usr/lib/presto/plugin/db2 diff --git a/README.md b/README.md index cf1183e..71cb027 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,14 @@ This is a docker image for [PrestoDB](https://prestosql.io/) with [Db2 connector **Notice**: it starts to switch the base image from openjdk to the official prestosql container image [`prestosql/presto`](https://hub.docker.com/r/prestosql/presto) since tag `325`. +## Build + +Run this command to build an image with prestodb release 347 and Db2 connector: + +```SHELL +docker build --build-arg PRESTO_VERSION=347 -t "shawnzhu/prestodb:347" . +``` + ## Start ```SHELL diff --git a/bin/run-presto b/bin/run-presto deleted file mode 100644 index 983e517..0000000 --- a/bin/run-presto +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -xeuo pipefail - -if [[ ! -d /usr/lib/presto/etc ]]; then - if [[ -d /etc/presto ]]; then - ln -s /etc/presto /usr/lib/presto/etc - else - ln -s /usr/lib/presto/default/etc /usr/lib/presto/etc - fi -fi - -set +e -grep -s -q 'node.id' /usr/lib/presto/etc/node.properties -NODE_ID_EXISTS=$? -set -e - -NODE_ID="" -if [[ ${NODE_ID_EXISTS} != 0 ]] ; then - NODE_ID="-Dnode.id=${HOSTNAME}" -fi - -exec /usr/lib/presto/bin/launcher run ${NODE_ID} "$@" \ No newline at end of file