Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# limitations under the License.

# syntax=docker/dockerfile:1

FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS jdk-download
ARG TRINO_GATEWAY_BASE_IMAGE
FROM ${TRINO_GATEWAY_BASE_IMAGE} AS jdk-download
ARG JDK_DOWNLOAD_LINK
ARG JDK_VERSION
ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_VERSION}"
Expand All @@ -26,8 +26,7 @@ RUN \
mkdir -p "${JAVA_HOME}" && \
curl -#LfS "${JDK_DOWNLOAD_LINK}" | tar -zx --strip 1 -C "${JAVA_HOME}"

# Use ubi9 minimal as it's more secure
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
FROM ${TRINO_GATEWAY_BASE_IMAGE}
WORKDIR /opt/trino

ARG JDK_VERSION
Expand Down
8 changes: 8 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ all the required artifacts:
./build.sh -r 4
```

Set the environment variable `TRINO_GATEWAY_BASE_IMAGE` to use a specific base image
to build Trino Gateway image.

```bash
export TRINO_GATEWAY_BASE_IMAGE=<image>
./build.sh
Comment on lines +87 to +88
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.sh already offers some arguments h,a,r,j to changer the behavior. Why do we need to use an environment variable for the base image?

Copy link
Copy Markdown
Member Author

@andythsu andythsu Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to create a new argument to change the base image then? Because right now the base image is using the one on dockerhub, but we will need to use our own base image to build the docker image.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script also uses a bunch of env variables.. so its kinda inconsistent .. I think of the trino image more like the java home path to be honest

```

## Getting Help

Join the Trino community [Slack](https://trino.io/slack.html).
3 changes: 3 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ cp "${SCRIPT_DIR}/Dockerfile" "${WORK_DIR}"

TAG_PREFIX="trino-gateway:${TRINO_GATEWAY_VERSION}"

TRINO_GATEWAY_BASE_IMAGE=${TRINO_GATEWAY_BASE_IMAGE:-'registry.access.redhat.com/ubi9/ubi-minimal:latest'}

for arch in "${ARCHITECTURES[@]}"; do
echo "🫙 Building the image for $arch with JDK ${JDK_VERSION}"
DOCKER_BUILDKIT=1 \
Expand All @@ -123,6 +125,7 @@ for arch in "${ARCHITECTURES[@]}"; do
--build-arg JDK_VERSION="${JDK_VERSION}" \
--build-arg JDK_DOWNLOAD_LINK="$(temurin_jdk_link "${JDK_VERSION}" "${arch}")" \
--build-arg TRINO_GATEWAY_VERSION="${TRINO_GATEWAY_VERSION}" \
--build-arg TRINO_GATEWAY_BASE_IMAGE="${TRINO_GATEWAY_BASE_IMAGE}" \
--platform "linux/$arch" \
-f Dockerfile \
-t "${TAG_PREFIX}-$arch"
Expand Down