[Dockerfiles] Used best practices for apt-get
See https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#apt-get
- Replaced `-y install` with `install -y` (unification)
- Put every package on its own line
- Moved `rm -rf /var/lib/apt/lists/*` in the same `RUN` statement as `apt-get`
- Removed unnecessary `apt-get clean`
See 03e2923e42/contrib/mkimage/debootstrap (L82-L105)
master
parent
d0d0961006
commit
9ab9d76240
|
@ -8,14 +8,12 @@ ENV DEBIAN_VERSION stretch
|
||||||
RUN echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION main contrib non-free" > /etc/apt/sources.list && \
|
RUN echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION main contrib non-free" > /etc/apt/sources.list && \
|
||||||
echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION-updates main contrib non-free" >> /etc/apt/sources.list && \
|
echo "deb http://http.debian.net/debian/ $DEBIAN_VERSION-updates main contrib non-free" >> /etc/apt/sources.list && \
|
||||||
echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib non-free" >> /etc/apt/sources.list && \
|
echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib non-free" >> /etc/apt/sources.list && \
|
||||||
apt-get update && \
|
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -qq \
|
|
||||||
clamav-daemon \
|
clamav-daemon \
|
||||||
clamav-freshclam \
|
clamav-freshclam \
|
||||||
libclamunrar7 \
|
libclamunrar7 \
|
||||||
curl && \
|
curl \
|
||||||
apt-get clean && \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# initial update of av databases
|
# initial update of av databases
|
||||||
COPY dl_files.sh /dl_files.sh
|
COPY dl_files.sh /dl_files.sh
|
||||||
|
|
|
@ -7,8 +7,8 @@ ENV LC_ALL C
|
||||||
ENV DOVECOT_VERSION 2.2.29.1
|
ENV DOVECOT_VERSION 2.2.29.1
|
||||||
ENV PIGEONHOLE_VERSION 0.4.18
|
ENV PIGEONHOLE_VERSION 0.4.18
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update && apt-get -y install \
|
||||||
&& apt-get -y install libpam-dev \
|
libpam-dev \
|
||||||
default-libmysqlclient-dev \
|
default-libmysqlclient-dev \
|
||||||
lzma-dev \
|
lzma-dev \
|
||||||
liblz-dev \
|
liblz-dev \
|
||||||
|
@ -48,7 +48,8 @@ RUN apt-get update \
|
||||||
libdbd-mysql-perl \
|
libdbd-mysql-perl \
|
||||||
libipc-run-perl \
|
libipc-run-perl \
|
||||||
make \
|
make \
|
||||||
cpanminus
|
cpanminus \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
RUN wget https://www.dovecot.org/releases/2.2/dovecot-$DOVECOT_VERSION.tar.gz -O - | tar xvz \
|
RUN wget https://www.dovecot.org/releases/2.2/dovecot-$DOVECOT_VERSION.tar.gz -O - | tar xvz \
|
||||||
|
@ -100,8 +101,7 @@ EXPOSE 24 10001
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
RUN apt-get clean \
|
RUN rm -rf \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
/var/tmp/* \
|
/var/tmp/* \
|
||||||
/dovecot-2.2-pigeonhole-$PIGEONHOLE_VERSION \
|
/dovecot-2.2-pigeonhole-$PIGEONHOLE_VERSION \
|
||||||
|
|
|
@ -3,14 +3,15 @@ LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update && apt-get install -y \
|
||||||
&& apt-get install -y zlib1g-dev \
|
zlib1g-dev \
|
||||||
libicu-dev \
|
libicu-dev \
|
||||||
g++ \
|
g++ \
|
||||||
libidn11-dev \
|
libidn11-dev \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
redis-tools \
|
redis-tools \
|
||||||
mysql-client
|
mysql-client \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN docker-php-ext-configure intl
|
RUN docker-php-ext-configure intl
|
||||||
RUN docker-php-ext-install intl pdo pdo_mysql xmlrpc
|
RUN docker-php-ext-install intl pdo pdo_mysql xmlrpc
|
||||||
|
|
|
@ -9,8 +9,8 @@ RUN dpkg-divert --local --rename --add /sbin/initctl \
|
||||||
&& dpkg-divert --local --rename --add /usr/bin/ischroot \
|
&& dpkg-divert --local --rename --add /usr/bin/ischroot \
|
||||||
&& ln -sf /bin/true /usr/bin/ischroot
|
&& ln -sf /bin/true /usr/bin/ischroot
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
RUN apt-get install -y --no-install-recommends supervisor \
|
supervisor \
|
||||||
postfix \
|
postfix \
|
||||||
sasl2-bin \
|
sasl2-bin \
|
||||||
libsasl2-modules \
|
libsasl2-modules \
|
||||||
|
@ -25,7 +25,8 @@ RUN apt-get install -y --no-install-recommends supervisor \
|
||||||
python-gpgme \
|
python-gpgme \
|
||||||
sudo \
|
sudo \
|
||||||
curl \
|
curl \
|
||||||
dirmngr
|
dirmngr \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN addgroup --system --gid 600 zeyple
|
RUN addgroup --system --gid 600 zeyple
|
||||||
RUN adduser --system --home /var/lib/zeyple --no-create-home --uid 600 --gid 600 --disabled-login zeyple
|
RUN adduser --system --home /var/lib/zeyple --no-create-home --uid 600 --gid 600 --disabled-login zeyple
|
||||||
|
@ -44,4 +45,4 @@ EXPOSE 588
|
||||||
|
|
||||||
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN rm -rf /tmp/* /var/tmp/*
|
||||||
|
|
|
@ -6,8 +6,13 @@ ENV LC_ALL C
|
||||||
|
|
||||||
RUN apt-key adv --fetch-keys http://rspamd.com/apt-stable/gpg.key \
|
RUN apt-key adv --fetch-keys http://rspamd.com/apt-stable/gpg.key \
|
||||||
&& echo "deb http://rspamd.com/apt-stable/ jessie main" > /etc/apt/sources.list.d/rspamd.list \
|
&& echo "deb http://rspamd.com/apt-stable/ jessie main" > /etc/apt/sources.list.d/rspamd.list \
|
||||||
&& apt-get update \
|
&& apt-get update && apt-get install -y --force-yes --no-install-recommends \
|
||||||
&& apt-get --no-install-recommends -y --force-yes install rmilter cron syslog-ng syslog-ng-core supervisor
|
rmilter \
|
||||||
|
cron \
|
||||||
|
syslog-ng \
|
||||||
|
syslog-ng-core \
|
||||||
|
supervisor \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
|
@ -18,4 +23,4 @@ RUN touch /var/log/mail.log && chmod 640 /var/log/mail.log && chown root:adm /va
|
||||||
|
|
||||||
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN rm -rf /tmp/* /var/tmp/*
|
||||||
|
|
|
@ -6,8 +6,11 @@ ENV LC_ALL C
|
||||||
|
|
||||||
RUN apt-key adv --fetch-keys http://rspamd.com/apt-stable/gpg.key \
|
RUN apt-key adv --fetch-keys http://rspamd.com/apt-stable/gpg.key \
|
||||||
&& echo "deb http://rspamd.com/apt-stable/ jessie main" > /etc/apt/sources.list.d/rspamd.list \
|
&& echo "deb http://rspamd.com/apt-stable/ jessie main" > /etc/apt/sources.list.d/rspamd.list \
|
||||||
&& apt-get update \
|
&& apt-get update && apt-get install -y \
|
||||||
&& apt-get -y install rspamd ca-certificates python-pip
|
rspamd \
|
||||||
|
ca-certificates \
|
||||||
|
python-pip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN echo '.include $LOCAL_CONFDIR/local.d/rspamd.conf.local' > /etc/rspamd/rspamd.conf.local
|
RUN echo '.include $LOCAL_CONFDIR/local.d/rspamd.conf.local' > /etc/rspamd/rspamd.conf.local
|
||||||
|
|
||||||
|
@ -18,7 +21,7 @@ RUN pip install -U oletools
|
||||||
|
|
||||||
CMD /usr/bin/rspamd -f -u _rspamd -g _rspamd
|
CMD /usr/bin/rspamd -f -u _rspamd -g _rspamd
|
||||||
|
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN rm -rf /tmp/* /var/tmp/*
|
||||||
|
|
||||||
USER _rspamd
|
USER _rspamd
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,9 @@ ENV DEBIAN_FRONTEND noninteractive
|
||||||
ENV LC_ALL C
|
ENV LC_ALL C
|
||||||
ENV GOSU_VERSION 1.9
|
ENV GOSU_VERSION 1.9
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
&& apt-get install -y --no-install-recommends apt-transport-https gnupg \
|
apt-transport-https \
|
||||||
|
gnupg \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
wget \
|
wget \
|
||||||
syslog-ng \
|
syslog-ng \
|
||||||
|
@ -14,6 +15,7 @@ RUN apt-get update \
|
||||||
supervisor \
|
supervisor \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
cron \
|
cron \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
|
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
|
||||||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
|
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
|
||||||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
|
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
|
||||||
|
@ -29,8 +31,10 @@ RUN touch /usr/share/doc/sogo/empty.sh
|
||||||
|
|
||||||
RUN apt-key adv --keyserver keys.gnupg.net --recv-key 0x810273C4 \
|
RUN apt-key adv --keyserver keys.gnupg.net --recv-key 0x810273C4 \
|
||||||
&& echo "deb http://packages.inverse.ca/SOGo/nightly/3/debian/ jessie jessie" > /etc/apt/sources.list.d/sogo.list \
|
&& echo "deb http://packages.inverse.ca/SOGo/nightly/3/debian/ jessie jessie" > /etc/apt/sources.list.d/sogo.list \
|
||||||
&& apt-get update \
|
&& apt-get update && apt-get install -y --force-yes \
|
||||||
&& apt-get -y --force-yes install sogo sogo-activesync
|
sogo \
|
||||||
|
sogo-activesync \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf
|
RUN sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf
|
||||||
RUN echo '* * * * * sogo /usr/sbin/sogo-ealarms-notify' > /etc/cron.d/sogo
|
RUN echo '* * * * * sogo /usr/sbin/sogo-ealarms-notify' > /etc/cron.d/sogo
|
||||||
|
@ -42,4 +46,4 @@ COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||||
|
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN rm -rf /tmp/* /var/tmp/*
|
||||||
|
|
Loading…
Reference in New Issue