question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding Drivers to Custom Dockerfile

See original GitHub issue

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:

<?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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kseniiaguzeevacommented, Feb 11, 2021

Please ask to reopen the ticket if you have some additional questions.

1reaction
momijicommented, Jan 12, 2021

Hi,

@momiji It adds some clarity––it looks like your flow involves cloning both DBeaver and Cloudbeaver, making adjustments to each repository, and then building them with the changes. Please correct me if I’m wrong.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker container driver
The buildx Docker container driver allows creation of a managed and customizable BuildKit environment in a ... Specify custom BuildKit versions to use....
Read more >
Drivers overview | Docker Documentation
Use the docker buildx create command to create a builder, and specify the driver using the --driver option. ... This creates a new...
Read more >
About storage drivers - Docker Documentation
To use storage drivers effectively, it's important to know how Docker builds and stores images, and how these images are used by containers....
Read more >
Docker storage drivers
Docker supports several storage drivers, using a pluggable architecture. The storage driver controls how images and containers are stored and managed on ...
Read more >
Docker driver
The Buildx Docker driver is the default driver. It uses the BuildKit server components built directly into the Docker engine. The Docker driver...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found