summaryrefslogtreecommitdiffstats
path: root/.examples
diff options
context:
space:
mode:
Diffstat (limited to '.examples')
-rw-r--r--.examples/README.md38
-rw-r--r--.examples/dockerfiles/cron/fpm-alpine/Dockerfile10
-rw-r--r--.examples/dockerfiles/cron/fpm-alpine/supervisord.conf22
-rw-r--r--.examples/dockerfiles/full/apache/Dockerfile60
-rw-r--r--.examples/dockerfiles/full/fpm-alpine/Dockerfile51
-rw-r--r--.examples/dockerfiles/full/fpm-alpine/supervisord.conf22
-rw-r--r--.examples/dockerfiles/full/fpm/Dockerfile60
-rw-r--r--.examples/dockerfiles/imap/apache/Dockerfile31
-rw-r--r--.examples/dockerfiles/imap/fpm-alpine/Dockerfile22
-rw-r--r--.examples/dockerfiles/imap/fpm/Dockerfile31
-rw-r--r--.examples/dockerfiles/smb/fpm-alpine/Dockerfile3
11 files changed, 295 insertions, 55 deletions
diff --git a/.examples/README.md b/.examples/README.md
index f2842d92..015ff53e 100644
--- a/.examples/README.md
+++ b/.examples/README.md
@@ -21,43 +21,43 @@ Example | Description
### full
The `full` Dockerfile example adds dependencies for all optional packages suggested by nextcloud that may be needed for some features (e.g. Video Preview Generation), as stated in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html).
-NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the 13th line of the Dockerfile.
+NOTE: The Dockerfile does not install the LibreOffice package (line is commented), because it would increase the generated Image size by approximately 500 MB. In order to install it, simply uncomment the appropriate line in the Dockerfile.
-NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews)
+NOTE: Per default, only previews for BMP, GIF, JPEG, MarkDown, MP3, PNG, TXT, and XBitmap Files are generated. The configuration of the preview generation can be done in config.php, as explained in the [Administration Manual](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#previews)
-NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors.
+NOTE: Nextcloud recommends [disabling preview generation](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/harden_server.html?highlight=enabledpreviewproviders#disable-preview-image-generation) for high security deployments, as preview generation opens your nextcloud instance to new possible attack vectors.
The required steps for each optional/recommended package that is not already in the Nextcloud image are listed here, so that the Dockerfile can easily be modified to only install the needed extra packages. Simply remove the steps for the unwanted packages from the Dockerfile.
#### PHP Module bz2
-`docker-php-ext-install bz2`
+`docker-php-ext-install bz2`
#### PHP Module imap
-`apt install libc-client-dev libkrb5-dev`
-`docker-php-ext-configure imap --with-kerberos --with-imap-ssl`
-`docker-php-ext-install imap`
+`apt install libc-client-dev libkrb5-dev`
+`docker-php-ext-configure imap --with-kerberos --with-imap-ssl`
+`docker-php-ext-install imap`
#### PHP Module gmp
-`apt install libgmp3-dev`
-`docker-php-ext-install gmp`
+`apt install libgmp3-dev`
+`docker-php-ext-install gmp`
#### PHP Module smbclient
-`apt install smbclient libsmbclient-dev`
-`pecl install smbclient`
-`docker-php-ext-enable smbclient`
+`apt install smbclient libsmbclient-dev`
+`pecl install smbclient`
+`docker-php-ext-enable smbclient`
#### ffmpeg
-`apt install ffmpeg`
+`apt install ffmpeg`
#### LibreOffice
-`apt install libreoffice`
+`apt install libreoffice`
#### CRON via supervisor
-`apt install supervisor`
-`mkdir /var/log/supervisord /var/run/supervisord`
-The following Dockerfile commands are also necessary for a sucessfull cron installation:
-`COPY supervisord.conf /etc/supervisor/supervisord.conf`
-`CMD ["/usr/bin/supervisord"]`
+`apt install supervisor`
+`mkdir /var/log/supervisord /var/run/supervisord`
+The following Dockerfile commands are also necessary for a sucessfull cron installation:
+`COPY supervisord.conf /etc/supervisor/supervisord.conf`
+`CMD ["/usr/bin/supervisord"]`
diff --git a/.examples/dockerfiles/cron/fpm-alpine/Dockerfile b/.examples/dockerfiles/cron/fpm-alpine/Dockerfile
new file mode 100644
index 00000000..820b3f9a
--- /dev/null
+++ b/.examples/dockerfiles/cron/fpm-alpine/Dockerfile
@@ -0,0 +1,10 @@
+FROM nextcloud:fpm-alpine
+
+RUN apk add --no-cache supervisor \
+ && mkdir /var/log/supervisord /var/run/supervisord
+
+COPY supervisord.conf /etc/supervisor/supervisord.conf
+
+ENV NEXTCLOUD_UPDATE=1
+
+CMD ["/usr/bin/supervisord"]
diff --git a/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf b/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf
new file mode 100644
index 00000000..4f762592
--- /dev/null
+++ b/.examples/dockerfiles/cron/fpm-alpine/supervisord.conf
@@ -0,0 +1,22 @@
+[supervisord]
+nodaemon=true
+logfile=/var/log/supervisord/supervisord.log
+pidfile=/var/run/supervisord/supervisord.pid
+childlogdir=/var/log/supervisord/
+logfile_maxbytes=50MB ; maximum size of logfile before rotation
+logfile_backups=10 ; number of backed up logfiles
+loglevel=error
+
+[program:php-fpm]
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+command=php-fpm
+
+[program:cron]
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+command=/cron.sh
diff --git a/.examples/dockerfiles/full/apache/Dockerfile b/.examples/dockerfiles/full/apache/Dockerfile
index 178ca844..4ddcea8e 100644
--- a/.examples/dockerfiles/full/apache/Dockerfile
+++ b/.examples/dockerfiles/full/apache/Dockerfile
@@ -1,23 +1,57 @@
FROM nextcloud:apache
-RUN mkdir -p /usr/share/man/man1 \
- && apt-get update && apt-get install -y \
- supervisor \
+RUN set -ex; \
+ \
+ apt-get update; \
+ apt-get install -y --no-install-recommends \
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 \
- libgmp3-dev \
libc-client-dev \
+ libgmp3-dev \
libkrb5-dev \
- smbclient \
libsmbclient-dev \
-# libreoffice \
- && rm -rf /var/lib/apt/lists/* \
- && 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 \
- && docker-php-ext-install bz2 gmp imap \
- && pecl install smbclient \
- && docker-php-ext-enable smbclient \
- && mkdir /var/log/supervisord /var/run/supervisord
+ ; \
+ \
+ 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; \
+ docker-php-ext-install \
+ bz2 \
+ gmp \
+ 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 \
+ /var/log/supervisord \
+ /var/run/supervisord \
+;
COPY supervisord.conf /etc/supervisor/supervisord.conf
diff --git a/.examples/dockerfiles/full/fpm-alpine/Dockerfile b/.examples/dockerfiles/full/fpm-alpine/Dockerfile
new file mode 100644
index 00000000..716b32ff
--- /dev/null
+++ b/.examples/dockerfiles/full/fpm-alpine/Dockerfile
@@ -0,0 +1,51 @@
+FROM nextcloud:fpm-alpine
+
+RUN set -ex; \
+ \
+ apk add --no-cache \
+ ffmpeg \
+ samba-client \
+ supervisor \
+# libreoffice \
+ ;
+
+RUN set -ex; \
+ \
+ apk add --no-cache --virtual .build-deps \
+ $PHPIZE_DEPS \
+ imap-dev \
+ krb5-dev \
+ libressl-dev \
+ samba-dev \
+ bzip2-dev \
+ gmp-dev \
+ ; \
+ \
+ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
+ docker-php-ext-install \
+ bz2 \
+ gmp \
+ imap \
+ ; \
+ pecl install smbclient; \
+ docker-php-ext-enable smbclient; \
+ \
+ runDeps="$( \
+ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
+ | tr ',' '\n' \
+ | sort -u \
+ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
+ )"; \
+ apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
+ apk del .build-deps
+
+RUN mkdir -p \
+ /var/log/supervisord \
+ /var/run/supervisord \
+;
+
+COPY supervisord.conf /etc/supervisor/supervisord.conf
+
+ENV NEXTCLOUD_UPDATE=1
+
+CMD ["/usr/bin/supervisord"]
diff --git a/.examples/dockerfiles/full/fpm-alpine/supervisord.conf b/.examples/dockerfiles/full/fpm-alpine/supervisord.conf
new file mode 100644
index 00000000..4f762592
--- /dev/null
+++ b/.examples/dockerfiles/full/fpm-alpine/supervisord.conf
@@ -0,0 +1,22 @@
+[supervisord]
+nodaemon=true
+logfile=/var/log/supervisord/supervisord.log
+pidfile=/var/run/supervisord/supervisord.pid
+childlogdir=/var/log/supervisord/
+logfile_maxbytes=50MB ; maximum size of logfile before rotation
+logfile_backups=10 ; number of backed up logfiles
+loglevel=error
+
+[program:php-fpm]
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+command=php-fpm
+
+[program:cron]
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+command=/cron.sh
diff --git a/.examples/dockerfiles/full/fpm/Dockerfile b/.examples/dockerfiles/full/fpm/Dockerfile
index b0c61d64..deab8d8b 100644
--- a/.examples/dockerfiles/full/fpm/Dockerfile
+++ b/.examples/dockerfiles/full/fpm/Dockerfile
@@ -1,23 +1,57 @@
FROM nextcloud:fpm
-RUN mkdir -p /usr/share/man/man1 \
- && apt-get update && apt-get install -y \
- supervisor \
+RUN set -ex; \
+ \
+ apt-get update; \
+ apt-get install -y --no-install-recommends \
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 \
- libgmp3-dev \
libc-client-dev \
+ libgmp3-dev \
libkrb5-dev \
- smbclient \
libsmbclient-dev \
-# libreoffice \
- && rm -rf /var/lib/apt/lists/* \
- && 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 \
- && docker-php-ext-install bz2 gmp imap \
- && pecl install smbclient \
- && docker-php-ext-enable smbclient \
- && mkdir /var/log/supervisord /var/run/supervisord
+ ; \
+ \
+ 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; \
+ docker-php-ext-install \
+ bz2 \
+ gmp \
+ 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 \
+ /var/log/supervisord \
+ /var/run/supervisord \
+;
COPY supervisord.conf /etc/supervisor/supervisord.conf
diff --git a/.examples/dockerfiles/imap/apache/Dockerfile b/.examples/dockerfiles/imap/apache/Dockerfile
index f7958c08..5f24c756 100644
--- a/.examples/dockerfiles/imap/apache/Dockerfile
+++ b/.examples/dockerfiles/imap/apache/Dockerfile
@@ -1,7 +1,28 @@
FROM nextcloud:apache
-RUN apt-get update \
- && apt-get install -y libc-client-dev libkrb5-dev \
- && rm -rf /var/lib/apt/lists/* \
- && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
- && docker-php-ext-install imap
+RUN set -ex; \
+ \
+ savedAptMark="$(apt-mark showmanual)"; \
+ \
+ 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/*
diff --git a/.examples/dockerfiles/imap/fpm-alpine/Dockerfile b/.examples/dockerfiles/imap/fpm-alpine/Dockerfile
new file mode 100644
index 00000000..289c2a99
--- /dev/null
+++ b/.examples/dockerfiles/imap/fpm-alpine/Dockerfile
@@ -0,0 +1,22 @@
+FROM nextcloud:fpm-alpine
+
+RUN set -ex; \
+ \
+ apk add --no-cache --virtual .build-deps \
+ $PHPIZE_DEPS \
+ imap-dev \
+ krb5-dev \
+ libressl-dev \
+ ; \
+ \
+ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
+ docker-php-ext-install imap; \
+ \
+ runDeps="$( \
+ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
+ | tr ',' '\n' \
+ | sort -u \
+ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
+ )"; \
+ apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
+ apk del .build-deps
diff --git a/.examples/dockerfiles/imap/fpm/Dockerfile b/.examples/dockerfiles/imap/fpm/Dockerfile
index b403de66..f692fd7a 100644
--- a/.examples/dockerfiles/imap/fpm/Dockerfile
+++ b/.examples/dockerfiles/imap/fpm/Dockerfile
@@ -1,7 +1,28 @@
FROM nextcloud:fpm
-RUN apt-get update \
- && apt-get install -y libc-client-dev libkrb5-dev \
- && rm -rf /var/lib/apt/lists/* \
- && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
- && docker-php-ext-install imap
+RUN set -ex; \
+ \
+ savedAptMark="$(apt-mark showmanual)"; \
+ \
+ 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/*
diff --git a/.examples/dockerfiles/smb/fpm-alpine/Dockerfile b/.examples/dockerfiles/smb/fpm-alpine/Dockerfile
new file mode 100644
index 00000000..a66cd93a
--- /dev/null
+++ b/.examples/dockerfiles/smb/fpm-alpine/Dockerfile
@@ -0,0 +1,3 @@
+FROM nextcloud:fpm-alpine
+
+RUN apk add --no-cache samba-client