Skip to content

Commit

Permalink
Merge pull request #2 from MaterializeInc/add_docker
Browse files Browse the repository at this point in the history
Add information to build metabase-materialize-driver into a Docker image
  • Loading branch information
JLDLaughlin authored Jan 29, 2020
2 parents 4bae3a3 + 1e65cd2 commit b54b672
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM metabase/metabase:latest
ADD https://github.com/MaterializeInc/metabase-materialize-driver/releases/download/0.0.1/materialize-driver-0.0.1-SNAPSHOT-standalone.jar /plugins/
RUN chmod 744 /plugins/materialize-driver-0.0.1-SNAPSHOT-standalone.jar
56 changes: 48 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,53 @@
The `metabase-materialize-driver` allows [Metabase](https://github.com/metabase/metabase)
to connect to an instance of Materialize.

## How to use the driver
![Choose Materialize from database dropdown](images/materialize-metabase.png)

## To Use the Driver

To use the `metabase-materialize-driver`, put a copy of the driver's
.jar file into the `/plugins` directory of your Metabase instance. Metabase
will register the driver automatically! (For deployment-specific details,
please consult the following sections.)

Once the Materialize driver is registered, use the following information
to connect:

| Field | Value |
| ----------------- |:---------:|
| Host | localhost |
| Port | 6875 |
| Database username | default |
| Database password | default |


### With Docker

To generate a Metabase Docker image containing the Materialize driver,
use [our Dockerfile](Dockerfile) and run the following command
from your terminal:
```shell script
cd /path/to/metabase-materialize-driver
docker build -f Dockerfile -t metabase-with-materialize .
```

Then, to start the container, run:
```shell script
docker run --rm -p 3000:3000 --name metabase metabase-with-materialize:latest
```

Once it's finished loading, you should be able to access Metabase at
`localhost:3000` in your browser.

**NB: If you are running this on a Mac and running Materialize locally,
you can connect by substituting the following connection information:**

| Field | Value |
| ----------------- |:--------------------:|
| Host | [host.docker.internal](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach/24326540#24326540) |


### Without Docker

Use this driver in two steps:
1. Download a copy of the driver by running:
Expand All @@ -12,18 +58,12 @@ Use this driver in two steps:
```
2. Move the downloaded copy of the driver (from the previous step)
into the `/plugins` directory of your Metabase instance.

Once the `metabase-materialize-driver` is added to your `/plugins`,
Metabase will register the driver automatically! You can then use the
new driver to connect to Materialize like any other database:
![Choose Materialize from database dropdown](images/materialize-metabase.png)


For more info, check out these resources:
* [Managing databases in Metabase](https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html)
* [Driver plugins in Metabase](https://github.com/metabase/metabase/wiki/Writing-a-Driver:-Packaging-a-Driver-&-Metabase-Plugin-Basics)

## How the driver is built
## To Build the Driver

**NB: These steps are not necessary to use the `metabase-materialize-driver`!
They are only for the curious or those attempting to make updates. To just use
Expand Down

0 comments on commit b54b672

Please sign in to comment.