Last updated:|... min read
Setup OLake
Create OLake Docker Image
Replace the DRIVER_NAME=mongodb
in the command below and the Dockerfile with the driver name you want to build the image for.
- For MongoDB, use
DRIVER_NAME=mongodb
- For MySQL, use
DRIVER_NAME=mysql
- For PostgreSQL, use
DRIVER_NAME=postgres
Build Docker Image for OLake
docker build -t source-DATABASE --build-arg DRIVER_NAME=DATABASE .
Run the Docker Image
docker run \
-v /Users/{PATH_TO_OLAKE_DIRECTORY}/olake-docker:/mnt/config \
source-DATABASE \
discover \
--config /mnt/config/config.json
The Dockerfile
Dockerfile
# Build Stage
FROM golang:1.22-alpine AS base
WORKDIR /home/app
COPY . .
ARG DRIVER_NAME=mongodb
# Build the Go binary
WORKDIR /home/app/drivers/${DRIVER_NAME}
RUN go build -o /olake main.go
# Final Runtime Stage
FROM alpine:3.18
# Install Java 17 instead of Java 11
RUN apk add --no-cache openjdk17
# Copy the binary from the build stage
COPY /olake /home/olake
# Copy the pre-built JAR file from Maven
# First try to copy from the source location (works after Maven build)
COPY writers/iceberg/debezium-server-iceberg-sink/target/debezium-server-iceberg-sink-0.0.1-SNAPSHOT.jar /home/debezium-server-iceberg-sink.jar
ARG DRIVER_VERSION=dev
ARG DRIVER_NAME=mongodb
# Metadata
LABEL io.eggwhite.version=${DRIVER_VERSION}
LABEL io.eggwhite.name=olake/source-${DRIVER_NAME}
# Set working directory
WORKDIR /home
# Entrypoint
ENTRYPOINT ["./olake"]