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

Reduce size of final image by removing apt caches #21

Merged
merged 11 commits into from
Oct 27, 2020
12 changes: 6 additions & 6 deletions 3.10.x/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM openjdk:11-jre-slim-buster

# Install GPG for package vefification
# Install GPG for package vefification and WGET for file download
RUN apt-get update \
&& apt-get -y install gnupg wget
&& apt-get -y install gnupg wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Add the liquibase user and step in the directory
RUN addgroup --gid 1001 liquibase
Expand All @@ -28,9 +30,7 @@ RUN set -x \
# Setup GPG
RUN GNUPGHOME="$(mktemp -d)"


# Download JDBC libraries, verify

RUN wget -O /liquibase/lib/postgresql.jar https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.12/postgresql-42.2.12.jar \
&& wget -O /liquibase/lib/postgresql.jar.asc https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.12/postgresql-42.2.12.jar.asc \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 38F47D3E410C47B1 \
Expand Down Expand Up @@ -77,12 +77,12 @@ RUN wget -O /liquibase/lib/sqlite.jar https://repo1.maven.org/maven2/org/xerial/
&& gpg --batch --verify -fSLo /liquibase/lib/sqlite.jar.asc /liquibase/lib/sqlite.jar

# No key published to Maven Central, using SHA256SUM

ARG MYSQL_SHA256=f93c6d717fff1bdc8941f0feba66ac13692e58dc382ca4b543cabbdb150d8bf7

RUN wget -O /liquibase/lib/mysql.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar \
&& echo "$MYSQL_SHA256 /liquibase/lib/mysql.jar" | sha256sum -c -

COPY --chown=liquibase:liquibase docker-entrypoint.sh /usr/local/bin/
RUN chmod 0755 /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["--help"]
CMD ["--help"]
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM openjdk:11-jre-slim-buster

# Install GPG for package vefification
# Install GNUPG for package vefification and WGET for file download
RUN apt-get update \
&& apt-get -y install gnupg wget
&& apt-get -y install gnupg wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Add the liquibase user and step in the directory
RUN addgroup --gid 1001 liquibase
Expand All @@ -28,9 +30,7 @@ RUN set -x \
# Setup GPG
RUN GNUPGHOME="$(mktemp -d)"


# Download JDBC libraries, verify

RUN wget -O /liquibase/lib/postgresql.jar https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.12/postgresql-42.2.12.jar \
&& wget -O /liquibase/lib/postgresql.jar.asc https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.12/postgresql-42.2.12.jar.asc \
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 38F47D3E410C47B1 \
Expand Down Expand Up @@ -77,12 +77,12 @@ RUN wget -O /liquibase/lib/sqlite.jar https://repo1.maven.org/maven2/org/xerial/
&& gpg --batch --verify -fSLo /liquibase/lib/sqlite.jar.asc /liquibase/lib/sqlite.jar

# No key published to Maven Central, using SHA256SUM

ARG MYSQL_SHA256=f93c6d717fff1bdc8941f0feba66ac13692e58dc382ca4b543cabbdb150d8bf7

RUN wget -O /liquibase/lib/mysql.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar \
&& echo "$MYSQL_SHA256 /liquibase/lib/mysql.jar" | sha256sum -c -

COPY --chown=liquibase:liquibase docker-entrypoint.sh /usr/local/bin/
RUN chmod 0755 /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["--help"]
CMD ["--help"]