RUN set -ex; \
apt-get update; \
\
+ savedAptMark="$(apt-mark showmanual)"; \
+ \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libicu-dev \
zip \
; \
\
+# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
+ apt-mark auto '.*' > /dev/null; \
+ apt-mark manual $savedAptMark; \
+ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
+ | awk '/=>/ { print $3 }' \
+ | sort -u \
+ | xargs -r dpkg-query -S \
+ | cut -d: -f1 \
+ | sort -u \
+ | xargs -rt apt-mark manual; \
+ \
+ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# enable mod_rewrite
RUN set -ex; \
apt-get update; \
\
+ savedAptMark="$(apt-mark showmanual)"; \
+ \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libicu-dev \
zip \
; \
\
+# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
+ apt-mark auto '.*' > /dev/null; \
+ apt-mark manual $savedAptMark; \
+ ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
+ | awk '/=>/ { print $3 }' \
+ | sort -u \
+ | xargs -r dpkg-query -S \
+ | cut -d: -f1 \
+ | sort -u \
+ | xargs -rt apt-mark manual; \
+ \
+ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# expose these volumes