forked from phpmyadmin/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (70 loc) · 2.69 KB
/
Copy pathDockerfile
File metadata and controls
78 lines (70 loc) · 2.69 KB
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
FROM php:7.2-fpm-alpine
RUN apk add --no-cache \
nginx \
supervisor
# Install dependencies
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
bzip2-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install bz2 gd mysqli opcache zip; \
\
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 .phpmyadmin-phpexts-rundeps $runDeps; \
apk del .build-deps
# Calculate download URL
ENV VERSION 4.8.3
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
# Download tarball, verify it using gpg and extract
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
gnupg \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv phpMyAdmin-$VERSION-all-languages /www; \
rm -rf /www/setup/ /www/examples/ /www/test/ /www/po/ /www/composer.json /www/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php; \
chown -R nobody:nogroup /www; \
find /www -type d -exec chmod 750 {} \; ; \
find /www -type f -exec chmod 640 {} \; ; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /www/tmp; \
chmod -R 777 /www/tmp; \
apk del .fetch-deps
# Copy configuration
COPY etc /etc/
COPY php.ini /usr/local/etc/php/conf.d/php-phpmyadmin.ini
# Copy main script
COPY run.sh /run.sh
# We expose phpMyAdmin on port 80
EXPOSE 80
ENTRYPOINT [ "/run.sh" ]
CMD ["supervisord", "-n"]