This commit is contained in:
gregory hendrickson
2023-10-31 09:06:29 -07:00
parent 48f1fee0a9
commit 4aa1427cef

View File

@@ -1,25 +1,29 @@
FROM nextcloud:fpm-alpine FROM nextcloud:apache
RUN set -ex; \ RUN set -ex; \
\ \
apk add --no-cache \ apt-get update; \
apt-get install -y --no-install-recommends \
ffmpeg \ ffmpeg \
imagemagick \ ghostscript \
libmagickcore-6.q16-6-extra \
procps \ procps \
samba-client \ smbclient \
supervisor \ supervisor \
# libreoffice \ # libreoffice \
; ; \
rm -rf /var/lib/apt/lists/*
RUN set -ex; \ RUN set -ex; \
\ \
apk add --no-cache --virtual .build-deps \ savedAptMark="$(apt-mark showmanual)"; \
$PHPIZE_DEPS \ \
imap-dev \ apt-get update; \
krb5-dev \ apt-get install -y --no-install-recommends \
openssl-dev \ libbz2-dev \
samba-dev \ libc-client-dev \
bzip2-dev \ libkrb5-dev \
libsmbclient-dev \
; \ ; \
\ \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
@@ -30,14 +34,19 @@ RUN set -ex; \
pecl install smbclient; \ pecl install smbclient; \
docker-php-ext-enable smbclient; \ docker-php-ext-enable smbclient; \
\ \
runDeps="$( \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ apt-mark auto '.*' > /dev/null; \
| tr ',' '\n' \ apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \ | sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ | xargs -r dpkg-query --search \
)"; \ | cut -d: -f1 \
apk add --virtual .nextcloud-phpext-rundeps $runDeps; \ | sort -u \
apk del .build-deps | 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 \ RUN mkdir -p \
/var/log/supervisord \ /var/log/supervisord \