11#! /usr/bin/env bash
22
3- set -euo pipefail
3+ SOURCE_DIR= ` dirname " ${BASH_SOURCE[0]} " `
44
5- echo " Removing existing container... "
5+ source " $SOURCE_DIR /env-presto.sh "
66
7- docker rm -fv presto 2> /dev/null || echo " Nothing to remove "
7+ source " $SOURCE_DIR /common.sh "
88
9- docker run -p 8080:8080 \
9+ kill-existing ${CONTAINER_NAME}
10+
11+ docker run -p ${HOST_PORT} :8080 \
1012 -p 8443:8443 \
11- --name presto \
13+ --name ${CONTAINER_NAME} \
1214 --hostname presto \
1315 --rm \
14- -d metabase/presto-mb-ci
15-
16- SERVER_CA_PEM_FILE=/tmp/presto-ssl-ca.pem
17- SERVER_CA_DER_FILE=/tmp/presto-ssl-ca.der
18- MODIFIED_CACERTS_FILE=/tmp/cacerts-with-presto-ssl.jks
16+ -d prestodb/presto:${PRESTO_VERSION}
1917
2018cat << EOF
21- Started Presto on port 8080 (insecure HTTP) and port 8443 (secure HTTPS) on the host machine
19+
20+ Started Presto on port ${HOST_PORT} (insecure HTTP) and port 8443 (secure HTTPS) on the host machine
2221
2322To make the self signed certificate that was generated for this Presto instance available to your Java application
2423(ex: Metabase), perform the following steps after Presto is completely online. You can run
2524
26- docker logs --tail 5 presto
25+ docker logs --tail 5 ${CONTAINER_NAME}
2726
2827to see the current output. Once Presto is online, you will see a line containing something like the following:
2928
@@ -44,4 +43,7 @@ also have the JAVA_HOME env var set for this all to work.
4443Finally, this can be made available to Metabase by adding the following JVM args when starting:
4544
4645 -Djavax.net.ssl.trustStore=$MODIFIED_CACERTS_FILE -Djavax.net.ssl.trustStorePassword=changeit
46+
4747EOF
48+
49+ print-presto-vars
0 commit comments