Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Introduce staged build and build argument (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnzhu authored Jan 20, 2021
1 parent f973b1d commit 799733e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 0 additions & 23 deletions bin/run-presto

This file was deleted.

0 comments on commit 799733e

Please sign in to comment.