Adding Drivers to Custom Dockerfile
See original GitHub issueI 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:
<?xml version="1.0" encoding="UTF-8"?> <plugin> <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.
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top GitHub Comments
Please ask to reopen the ticket if you have some additional questions.
Hi,
Absolutely, you’re right.
Concerning your idea ti build from docker image, what you’re proposing cannot work, because adding the pom.xml is not for the single purpose of adding a new file on the filesystem, but to add a new sub-project in the project building process (which uses maven, which uses pom.xml…).
So my understanding is you definitely need to rebuild the project… Then, rebuilding one or two, no difference especially as the build.sh script rebuilds both…
Regards.