-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
85 lines (79 loc) · 2.81 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM nextcloud:28.0.0-fpm@sha256:e347e1a7c7148c2b3bf4faef151b8ce999ef59b711ac15f7c0f29903ee0417b5
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
jq \
nano \
procps \
ffmpeg \
libheif1 \
smbclient \
libde265-0 \
libfcgi-bin \
heif-gdk-pixbuf \
imagemagick-common \
libmagickcore-6.q16-6-extra \
; \
\
# This command returns the list of manually installed packages
savedAptMark="$(apt-mark showmanual)"; \
\
# Install the build dependencies
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \
libkrb5-dev \
libc-client-dev \
libsmbclient-dev \
libmagickcore-dev \
; \
\
# Configure the IMAP extension to use Kerberos authentication and SSL.
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
# Install the PHP extensions
docker-php-ext-install \
# Bzip2 Compression Algorithm
bz2 \
imap \
; \
# Install smbclient from PECL
pecl install smbclient; \
# Enable smbclient extension
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; \
# Set the packages that were manually installed back to "manual"
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 \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
# Remove build dependencies and packages that are no longer needed
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
# Remove the apt cache
rm -rf /var/lib/apt/lists/*
# See https://github.com/nextcloud/docker/issues/763
RUN set -ex; \
\
touch /usr/local/etc/php/conf.d/redis-session.ini; \
touch /usr/local/etc/php-fpm.d/zz-tune.conf; \
chmod 777 /usr/local/etc/php/conf.d/redis-session.ini; \
chmod 777 /usr/local/etc/php-fpm.d/zz-tune.conf
# Copy post-install script to a temp location so we can append it to the entrypoint.sh
COPY --chmod=755 ./scripts/post-install.sh /tmp/post-install.sh
# Copy the configure-scripts that will be sourced by the post-install
COPY --chmod=755 ./configure-scripts /configure-scripts
# Copy the healthcheck
COPY --chmod=755 ./scripts/healthcheck.sh /healthcheck.sh
RUN set -ex; \
sed -i 's/exec "$@"//g' /entrypoint.sh; \
cat /tmp/post-install.sh >> /entrypoint.sh
COPY --chmod=755 ./scripts/occ /usr/bin/occ
COPY --chmod=755 ./scripts/cron.sh /cron.sh