Adding Drivers to Custom Dockerfile #82

Open
opened 2026-03-04 09:08:21 -05:00 by deekerman · 0 comments
Owner

Originally created by @jefflester on GitHub (Nov 12, 2020).

I am trying to add a driver to the CloudBeaver Docker container and am running into some issues. I believe this is similar to issue #208. Reading the Wiki, this was how I expected things would work from a Dockerfile perspective:

Dockerfile:

FROM dbeaver/cloudbeaver:1.2.0

ADD ./pom.xml server/drivers/prestosql/
ADD ./plugin.xml server/bundles/io.cloudbeaver.resources.drivers.base/

Driver pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>drivers.prestosql</artifactId>
    <version>1.0.0</version>
    <parent>
        <groupId>io.cloudbeaver</groupId>
        <artifactId>drivers</artifactId>
        <version>1.0.0</version>
        <relativePath>../</relativePath>
    </parent>
    <properties>
        <deps.output.dir>prestosql</deps.output.dir>
    </properties>
    <dependencies>
        <dependency>
            <groupId>io.prestosql</groupId>
            <artifactId>presto-jdbc</artifactId>
            <version>338</version>
        </dependency>
    </dependencies>
</project>

Plugin XML:

<!-- Bundles  -->
<extension point="org.jkiss.dbeaver.product.bundles">
    <bundle id="drivers.clickhouse" label="Clickhouse drivers"/>
    <bundle id="drivers.derby" label="Derby drivers"/>
    <bundle id="drivers.firebird" label="Firebird drivers"/>
    <bundle id="drivers.h2" label="H2 drivers"/>
    <bundle id="drivers.mysql" label="MySQL drivers"/>
    <bundle id="drivers.mariadb" label="MariaDB drivers"/>
    <bundle id="drivers.postgresql" label="PostgreSQL drivers"/>
    <bundle id="drivers.prestosql" label="PrestoSQL drivers"/>
    <bundle id="drivers.sqlite.xerial" label="SQLite drivers"/>
</extension>

<!-- Enabled drivers -->
<extension point="io.cloudbeaver.driver">
    <driver id="generic:yandex_clickhouse"/>
    <driver id="generic:derby_server"/>
    <driver id="jaybird:jaybird"/>
    <driver id="generic:h2_embedded"/>
    <driver id="mysql:mysql8"/>
    <driver id="mysql:mariaDB"/>
    <driver id="postgresql:postgres-jdbc"/>
    <driver id="generic:prestosql_jdbc"/>
    <driver id="generic:sqlite_jdbc"/>
</extension>
```

However, it appears these instructions expect the user to be building from source with the build.sh script after the relevant files have been updated/added. Going off that, it looks like the cloudbeaver source is added to the Docker image after the build.sh script is run, per the Dockerfile.

Is there an interim Maven command I need to add to the image entrypoint to get this to work? The default entrypoint ENTRYPOINT ["./run-server.sh"] does not register the added drivers since no build commands are executed.

Thanks for any and all clarification, and I am very excited to start using this! I'm happy to create a doc PR to update the instructions for adding drivers to a custom Dockerfile if that would be helpful as well.

Originally created by @jefflester on GitHub (Nov 12, 2020). I am trying to add a driver to the CloudBeaver Docker container and am running into some issues. I believe this is similar to issue #208. Reading the [Wiki](https://github.com/dbeaver/cloudbeaver/wiki/Driver-managements), this was how I expected things would work from a Dockerfile perspective: Dockerfile: ``` FROM dbeaver/cloudbeaver:1.2.0 ADD ./pom.xml server/drivers/prestosql/ ADD ./plugin.xml server/bundles/io.cloudbeaver.resources.drivers.base/ ``` Driver `pom.xml`: ``` <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>drivers.prestosql</artifactId> <version>1.0.0</version> <parent> <groupId>io.cloudbeaver</groupId> <artifactId>drivers</artifactId> <version>1.0.0</version> <relativePath>../</relativePath> </parent> <properties> <deps.output.dir>prestosql</deps.output.dir> </properties> <dependencies> <dependency> <groupId>io.prestosql</groupId> <artifactId>presto-jdbc</artifactId> <version>338</version> </dependency> </dependencies> </project> ``` Plugin XML: <?xml version="1.0" encoding="UTF-8"?> <plugin> <!-- Resource mappings --> <extension point="org.jkiss.dbeaver.resources"> <resource name="drivers/clickhouse"/> <resource name="drivers/derby"/> <resource name="drivers/jaybird"/> <resource name="drivers/h2"/> <resource name="drivers/mysql/mysql8"/> <resource name="drivers/mariadb"/> <resource name="drivers/postgresql"/> <resource name="drivers/prestosql"/> <resource name="drivers/sqlite/xerial"/> </extension> <!-- Bundles --> <extension point="org.jkiss.dbeaver.product.bundles"> <bundle id="drivers.clickhouse" label="Clickhouse drivers"/> <bundle id="drivers.derby" label="Derby drivers"/> <bundle id="drivers.firebird" label="Firebird drivers"/> <bundle id="drivers.h2" label="H2 drivers"/> <bundle id="drivers.mysql" label="MySQL drivers"/> <bundle id="drivers.mariadb" label="MariaDB drivers"/> <bundle id="drivers.postgresql" label="PostgreSQL drivers"/> <bundle id="drivers.prestosql" label="PrestoSQL drivers"/> <bundle id="drivers.sqlite.xerial" label="SQLite drivers"/> </extension> <!-- Enabled drivers --> <extension point="io.cloudbeaver.driver"> <driver id="generic:yandex_clickhouse"/> <driver id="generic:derby_server"/> <driver id="jaybird:jaybird"/> <driver id="generic:h2_embedded"/> <driver id="mysql:mysql8"/> <driver id="mysql:mariaDB"/> <driver id="postgresql:postgres-jdbc"/> <driver id="generic:prestosql_jdbc"/> <driver id="generic:sqlite_jdbc"/> </extension> </plugin> ``` However, it appears these instructions expect the user to be building from source with the `build.sh` script _after_ the relevant files have been updated/added. Going off that, it looks like the `cloudbeaver` source is added to the Docker image after the `build.sh` script is run, per the [Dockerfile](https://github.com/dbeaver/cloudbeaver/blob/devel/deploy/docker/Dockerfile#L6). Is there an interim Maven command I need to add to the image entrypoint to get this to work? The default entrypoint `ENTRYPOINT ["./run-server.sh"]` does not register the added drivers since no build commands are executed. Thanks for any and all clarification, and I am very excited to start using this! I'm happy to create a doc PR to update the instructions for adding drivers to a custom Dockerfile if that would be helpful as well.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#82
No description provided.