diff --git a/core/docker/Dockerfile b/core/docker/Dockerfile index f3c79a07f956..d983034cad8a 100644 --- a/core/docker/Dockerfile +++ b/core/docker/Dockerfile @@ -31,6 +31,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest ARG JDK_VERSION ENV JAVA_HOME="/usr/lib/jvm/jdk-${JDK_VERSION}" ENV PATH=$PATH:$JAVA_HOME/bin +ENV CATALOG_MANAGEMENT=static COPY --from=jdk-download $JAVA_HOME $JAVA_HOME RUN \ diff --git a/core/docker/default/etc/config.properties b/core/docker/default/etc/config.properties index a11cba39db46..559b9a37ea3e 100644 --- a/core/docker/default/etc/config.properties +++ b/core/docker/default/etc/config.properties @@ -3,3 +3,4 @@ coordinator=true node-scheduler.include-coordinator=true http-server.http.port=8080 discovery.uri=http://localhost:8080 +catalog.management=${ENV:CATALOG_MANAGEMENT} diff --git a/docs/src/main/sphinx/admin/properties-catalog.md b/docs/src/main/sphinx/admin/properties-catalog.md index f04a562b1235..80b3d8e66941 100644 --- a/docs/src/main/sphinx/admin/properties-catalog.md +++ b/docs/src/main/sphinx/admin/properties-catalog.md @@ -83,6 +83,6 @@ ignore on startup. - **Default value:** `false` Requires [](prop-catalog-store) to be set to `file`. If true, existing catalog -property files cannot be removed with `DROP CATALOG`, and now new catalog files +property files cannot be removed with `DROP CATALOG`, and no new catalog files can be written with identical names with `CREATE CATALOG`. As a result, a coordinator restart resets the known catalogs to the existing files only. diff --git a/docs/src/main/sphinx/installation/containers.md b/docs/src/main/sphinx/installation/containers.md index 1ae1cd1dbed9..bae24bf0d615 100644 --- a/docs/src/main/sphinx/installation/containers.md +++ b/docs/src/main/sphinx/installation/containers.md @@ -88,6 +88,18 @@ at `/etc/trino/catalog`, or individual catalog property files in it. If you want to use additional plugins, mount them at `/usr/lib/trino/plugin`. +To avoid having to create catalog files and mount them in the container, +you can enable dynamic catalog management by setting the `CATALOG_MANAGEMENT` +environmental variable to `dynamic`. + +```shell +$ docker run --name trino -d -p 8080:8080 -e CATALOG_MANAGEMENT=dynamic trinodb/trino +``` + +After connecting to Trino, execute (sql-catalog-management)= statements to +create drop catalogs as desired. To make these changes persistent across +container restarts, a volume must be mounted at `/etc/trino/catalog`. + ## Cleaning up You can stop and start the container, using the `docker stop trino` and