Best Method To Building Docker Image for Metabase

Hey guys,

I have a custom Metabase version (with added Driver support for Athena) which runs fine locally using the generated JAR file but when I try to build a docker image using docker build and try running a container, it’s not able to recognize the added driver. What would be the best way to create a custom docker image of Metabase rather than using the official images that are already on the Metabase Docker hub?

I have used this as basis:

I figured out that it was the Athena driver JAR file I required for it to work properly. Would the dockerFile within that directory serve as an area where I could copy it over?

Yes, if an additional .jar is needed in your image you’ll probably add a COPY to it as per usual Docker best practices.

And then within the image of course the .jar has to be on the Java classpath, but I guess you already have that part figured out with what you already got running outside Docker.

1 Like

@jornh Update: I was able to modify the DockerFile to download the associated Athena .jar file into the /plugins directory from where metabase.jar is but it still results in an Unable to resolve driver for query issue. Are there any other tips to solve this issue?

Sorry, it’s not easy (next to impossible) to help you with debugging this with the little additional information you have given …

Not meant as criticism , but inspiration: (I’m just as frustrated as you with this conversation)

@psinghz, im guessing you may have figured this out already, but for others, i will add this example Dockerfile for adding the athena plugin.


FROM metabase/metabase:v0.37.3

# Add athena driver jar to plugins directory
RUN cd /plugins && wget

hey, im trying to do this with a custom image which i need to install the athena plugin.

where i need to insert those lines? builder or runner part?