Trino Gateway Docker image¶
The Docker image of Trino Gateway is designed for the following use cases:
- Manual usage in front of Trino clusters with
docker
ordocker-compose
commands for development and testing. - Automated usage with Helm chart for deployment of the container on Kubernetes.
The latest version of the Trino Gateway container image is available on
DockerHub with the identifier trinodb/trino-gateway
. Append where
:<version>
with a version number to use a specific release, for example
trinodb/trino-gateway:11
.
Production setup¶
The healthcheck configurations in the docker-compose
file is for suitable
for development and testing purposes only. Change the configuration for
your production deployment based on the workload and your specific requirements.
Build requirements¶
This docker build process requires the following software:
Building a custom Docker image¶
Use the following steps to build a Docker image from your local Trino Gateway codebase
First, run the Maven build in the project root.
Then build the image for your desired processor architecture in the docker
directory:
By default, the scripts builds all valid processor architectures amd64
,
arm64
, and ppc64le
:
The Docker build process prints the ID of the built image. It also tags the
image with trino-gateway:xxx-SNAPSHOT-yyy
, where xxx-SNAPSHOT
is the version
number and-yyy
is the processor architecture:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
trino-gateway 6-SNAPSHOT-ppc64le a72b750d2745 33 seconds ago 547MB
trino-gateway 6-SNAPSHOT-arm64 bc5e8b0db63c 35 seconds ago 523MB
trino-gateway 6-SNAPSHOT-amd64 6c066fa5b0c5 36 seconds ago 518MB
...
To build an image for a specific, already released version of Trino Gateway, use
the -r
option. The build script downloads all the required artifacts:
Set the environment variable TRINO_GATEWAY_BASE_IMAGE
to use a specific base
image to build Trino Gateway image.
Use the -h
option for further help.
Run Trino Gateway¶
You can launch Trino Gateway and required PostgreSQL for testing purposes with
the following command examples using docker compose
.
Use a locally-built image on a ARM-based machine, such as a Macbook laptop.
Use a locally-built image on a AMD64-based machine, such as a typical Windows or Linux desktop or laptop.
Use a published image from Docker Hub.
The release process publishes images for Trino Gateway 6 and newer to DockerHub.
Next set the image and platform:
Start Trino Gateway and its PostgreSQL backend database, and wait until the health check is successful:
Inspect the logs for progress and troubleshooting:
Typically your operating system automatically sets the default Docker platform value. In some cases it can be useful to explicitly set it.
For example, on ARM64-based MacOS you can set it to use linux
because it
otherwise is potentially set to darwin
and there are no PostgreSQL images
available for darwin
and this can prevent starting the Trino Gateway with
docker compose.
You can also set platform without operating system identifier:
Running¶
Once everything is up and running, you can use the REST API to show the configured backends:
The Trino Gateway is available at http://localhost:8080.
The PostgreSQL backend database for Trino Gateway runs on localhost:5432
. You
can query it for troubleshooting and other purposes using the credentials and
details found in the docker-compose.yml
file.
Configuration¶
The image uses the configuration file gateway-ha/gateway-ha-config-docker.yml
from the project checkout, and mounts it at /opt/trino/gateway-ha-config.yml
.
Health check¶
By default the container health check uses the file docker/bin/health-check
mounted at /usr/lib/trino/bin/health-check
. The scripts expects a 2XX response
from the server at /api/public/backends
.