Refactor install process and remove build deps

Signed-off-by: J0WI <J0WI@users.noreply.github.com>
pull/596/head
J0WI 7 years ago
parent 030a743b39
commit 0e941215b1

@ -1,23 +1,58 @@
FROM nextcloud:apache FROM nextcloud:apache
RUN mkdir -p /usr/share/man/man1 \ RUN set -ex; \
&& apt-get update && apt-get install -y \ \
supervisor \ apt-get update; \
apt-get install -y --no-install-recommends \
ffmpeg \ ffmpeg \
smbclient \
supervisor \
# libreoffice \
; \
rm -rf /var/lib/apt/lists/*
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \ libbz2-dev \
libgmp3-dev \
libc-client-dev \ libc-client-dev \
libgmp3-dev \
libkrb5-dev \ libkrb5-dev \
smbclient \
libsmbclient-dev \ libsmbclient-dev \
# libreoffice \ ; \
&& rm -rf /var/lib/apt/lists/* \ \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
&& ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \ ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h; \
&& docker-php-ext-install bz2 gmp imap \ docker-php-ext-install \
&& pecl install smbclient \ bz2 \
&& docker-php-ext-enable smbclient \ gmp \
&& mkdir /var/log/supervisord /var/run/supervisord imap \
; \
pecl install smbclient; \
docker-php-ext-enable smbclient; \
\
# 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/*
RUN mkdir -p \
/usr/share/man/man1 \
/var/log/supervisord \
/var/run/supervisord \
;
COPY supervisord.conf /etc/supervisor/supervisord.conf COPY supervisord.conf /etc/supervisor/supervisord.conf

@ -1,23 +1,58 @@
FROM nextcloud:fpm FROM nextcloud:fpm
RUN mkdir -p /usr/share/man/man1 \ RUN set -ex; \
&& apt-get update && apt-get install -y \ \
supervisor \ apt-get update; \
apt-get install -y --no-install-recommends \
ffmpeg \ ffmpeg \
smbclient \
supervisor \
# libreoffice \
; \
rm -rf /var/lib/apt/lists/*
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \ libbz2-dev \
libgmp3-dev \
libc-client-dev \ libc-client-dev \
libgmp3-dev \
libkrb5-dev \ libkrb5-dev \
smbclient \
libsmbclient-dev \ libsmbclient-dev \
# libreoffice \ ; \
&& rm -rf /var/lib/apt/lists/* \ \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
&& ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h \ ln -s "/usr/include/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)/gmp.h" /usr/include/gmp.h; \
&& docker-php-ext-install bz2 gmp imap \ docker-php-ext-install \
&& pecl install smbclient \ bz2 \
&& docker-php-ext-enable smbclient \ gmp \
&& mkdir /var/log/supervisord /var/run/supervisord imap \
; \
pecl install smbclient; \
docker-php-ext-enable smbclient; \
\
# 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/*
RUN mkdir -p \
/usr/share/man/man1 \
/var/log/supervisord \
/var/run/supervisord \
;
COPY supervisord.conf /etc/supervisor/supervisord.conf COPY supervisord.conf /etc/supervisor/supervisord.conf

@ -1,7 +1,28 @@
FROM nextcloud:apache FROM nextcloud:apache
RUN apt-get update \ RUN set -ex; \
&& apt-get install -y libc-client-dev libkrb5-dev \ \
&& rm -rf /var/lib/apt/lists/* \ savedAptMark="$(apt-mark showmanual)"; \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ \
&& docker-php-ext-install imap apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libkrb5-dev \
; \
\
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install imap; \
\
# 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/*

@ -1,7 +1,28 @@
FROM nextcloud:fpm FROM nextcloud:fpm
RUN apt-get update \ RUN set -ex; \
&& apt-get install -y libc-client-dev libkrb5-dev \ \
&& rm -rf /var/lib/apt/lists/* \ savedAptMark="$(apt-mark showmanual)"; \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ \
&& docker-php-ext-install imap apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libkrb5-dev \
; \
\
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install imap; \
\
# 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/*

Loading…
Cancel
Save