Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBZ-7385 reduce docker image size #362

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion server/2.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM registry.access.redhat.com/ubi8/openjdk-11
# Stage 1: Build stage
FROM registry.access.redhat.com/ubi8/openjdk-11 AS builder

LABEL maintainer="Debezium Community"

Expand Down Expand Up @@ -47,6 +48,22 @@ RUN echo "$SERVER_MD5 /tmp/debezium.tar.gz" | md5sum -c - &&\
#
RUN chmod -R g+w,o+w $SERVER_HOME

# Stage 2: Final image
FROM registry.access.redhat.com/ubi8/openjdk-11

LABEL maintainer="Debezium Community"

ENV DEBEZIUM_VERSION=2.6.0.Alpha1 \
SERVER_HOME=/debezium \
MAVEN_REPO_CENTRAL="https://repo1.maven.org/maven2"

USER root
RUN microdnf clean all

USER jboss

COPY --from=builder $SERVER_HOME $SERVER_HOME

# Set the working directory to the Debezium Server home directory
WORKDIR $SERVER_HOME

Expand Down
22 changes: 18 additions & 4 deletions server/2.6/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM registry.access.redhat.com/ubi8/openjdk-11
# Stage 1: Build stage
FROM registry.access.redhat.com/ubi8/openjdk-11 AS builder

LABEL maintainer="Debezium Community"

Expand Down Expand Up @@ -29,19 +30,32 @@ RUN mkdir $SERVER_HOME/conf && \
#
# Download and install Debezium Server
#
COPY debezium-server-dist-2.2.0-SNAPSHOT.tar.gz /tmp/debezium.tar.gz
COPY debezium-server-dist-2.6.0-SNAPSHOT.tar.gz /tmp/debezium.tar.gz

#
# Verify the contents and then install ...
#
RUN tar xzf /tmp/debezium.tar.gz -C $SERVER_HOME --strip-components 1
RUN tar xzf /tmp/debezium.tar.gz -C $SERVER_HOME --strip-components 1 &&\
rm -f /opt/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
# Stage 2: Final image
FROM registry.access.redhat.com/ubi8/openjdk-11

LABEL maintainer="Debezium Community"
ENV SERVER_HOME=/debezium

USER root
RUN microdnf clean all

USER jboss

COPY --from=builder $SERVER_HOME $SERVER_HOME

WORKDIR $SERVER_HOME

#
Expand Down
18 changes: 17 additions & 1 deletion server/snapshot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM registry.access.redhat.com/ubi8/openjdk-11
# Stage 1: Build stage
FROM registry.access.redhat.com/ubi8/openjdk-11 AS builder

LABEL maintainer="Debezium Community"

Expand Down Expand Up @@ -47,6 +48,21 @@ RUN SNAPSHOT_VERSION=$(curl --silent -fSL $MAVEN_OSS_SNAPSHOT/io/debezium/debezi
#
RUN chmod -R g+w,o+w $SERVER_HOME

# Stage 2: Final image
FROM registry.access.redhat.com/ubi8/openjdk-11

LABEL maintainer="Debezium Community"
ENV DEBEZIUM_VERSION=$DEBEZIUM_VERSION \
SERVER_HOME=/debezium \
MAVEN_OSS_SNAPSHOT="https://oss.sonatype.org/content/repositories/snapshots"

USER root
RUN microdnf clean all

USER jboss

COPY --from=builder $SERVER_HOME $SERVER_HOME

# Set the working directory to the Debezium Server home directory
WORKDIR $SERVER_HOME

Expand Down
Loading