Skip to content

Instantly share code, notes, and snippets.

@preetjdp
Last active July 6, 2021 14:36
Show Gist options
  • Select an option

  • Save preetjdp/8b5013577a64019128d7af9c8f634370 to your computer and use it in GitHub Desktop.

Select an option

Save preetjdp/8b5013577a64019128d7af9c8f634370 to your computer and use it in GitHub Desktop.
Dockerfile for Debezium using openjdk 18
FROM openjdk:18
LABEL maintainer="Debezium Community"
#
# Set the version, home directory, and MD5 hash.
#
ENV DEBEZIUM_VERSION=1.6.0.Final \
SERVER_HOME=/debezium \
MAVEN_REPO_CENTRAL="https://repo1.maven.org/maven2"
ENV SERVER_URL_PATH=io/debezium/debezium-server-dist/$DEBEZIUM_VERSION/debezium-server-dist-$DEBEZIUM_VERSION.tar.gz \
SERVER_MD5=1335e6d6f2ad093d3a34a50da5023600
#
# Create a directory for Debezium Server
#
USER root
RUN microdnf -y install gzip && \
microdnf clean all && \
mkdir $SERVER_HOME && \
chmod 755 $SERVER_HOME
RUN mkdir $SERVER_HOME/conf && \
mkdir $SERVER_HOME/data
#
# Download and install Debezium Server
#
RUN curl -fSL -o /tmp/debezium.tar.gz "$MAVEN_REPO_CENTRAL/$SERVER_URL_PATH"
#
# Verify the contents and then install ...
#
RUN echo "$SERVER_MD5 /tmp/debezium.tar.gz" | md5sum -c - &&\
tar xzf /tmp/debezium.tar.gz -C $SERVER_HOME --strip-components 1 &&\
rm -f /tmp/debezium.tar.gz
#
# Allow random UID to use Debezium Server
#
RUN chmod -R g+w,o+w $SERVER_HOME
# Set the working directory to the Debezium Server home directory
WORKDIR $SERVER_HOME
#
# Expose the ports and set up volumes for the data, transaction log, and configuration
#
EXPOSE 8080
VOLUME ["/debezium/conf","/debezium/data"]
CMD ["/debezium/run.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment