Dockerfile optimization: --no-install-recommends ; rm -rf /var/lib/apt/lists/* ; apt-get purge -y --auto-remove
This commit is contained in:
parent
a5050cdf7f
commit
27870e9c50
@ -44,15 +44,17 @@ ENV CASSANDRA_LOG=/var/log/cassandra
|
||||
COPY logback.xml ${pkg.name}.conf start-db.sh stop-db.sh start-tb.sh upgrade-tb.sh install-tb.sh ${pkg.name}.deb /tmp/
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y curl nmap procps gnupg2 \
|
||||
&& apt-get install -y --no-install-recommends curl nmap procps gnupg2 \
|
||||
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(. /etc/os-release && echo -n $VERSION_CODENAME)-pgdg main" | tee --append /etc/apt/sources.list.d/pgdg.list > /dev/null \
|
||||
&& curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
||||
&& echo 'deb http://downloads.apache.org/cassandra/debian 40x main' | tee --append /etc/apt/sources.list.d/cassandra.list > /dev/null \
|
||||
&& curl -L https://downloads.apache.org/cassandra/KEYS | apt-key add - \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y cassandra cassandra-tools postgresql-12 \
|
||||
&& apt-get install -y --no-install-recommends cassandra cassandra-tools postgresql-${PG_MAJOR} \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& update-rc.d cassandra disable \
|
||||
&& update-rc.d postgresql disable \
|
||||
&& apt-get purge -y --auto-remove \
|
||||
&& sed -i.old '/ulimit/d' /etc/init.d/cassandra \
|
||||
&& chmod a+x /tmp/*.sh \
|
||||
&& mv /tmp/start-tb.sh /usr/bin \
|
||||
|
||||
@ -36,12 +36,14 @@ ENV PGLOG=/var/log/postgres
|
||||
COPY logback.xml ${pkg.name}.conf start-db.sh stop-db.sh start-tb.sh upgrade-tb.sh install-tb.sh ${pkg.name}.deb /tmp/
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y curl gnupg2 \
|
||||
&& apt-get install -y --no-install-recommends curl gnupg2 \
|
||||
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(. /etc/os-release && echo -n $VERSION_CODENAME)-pgdg main" | tee --append /etc/apt/sources.list.d/pgdg.list > /dev/null \
|
||||
&& curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y postgresql-12 \
|
||||
&& apt-get install -y --no-install-recommends postgresql-${PG_MAJOR} \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& update-rc.d postgresql disable \
|
||||
&& apt-get purge -y --auto-remove \
|
||||
&& chmod a+x /tmp/*.sh \
|
||||
&& mv /tmp/start-tb.sh /usr/bin \
|
||||
&& mv /tmp/upgrade-tb.sh /usr/bin \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user