Skip to content

Commit d9236df

Browse files
committed
Merge remote-tracking branch 'origin/pull/144'
2 parents 5e02108 + 3a01bac commit d9236df

File tree

4 files changed

+44
-22
lines changed

4 files changed

+44
-22
lines changed

Dockerfile

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1-
FROM alpine:3.7
1+
FROM php:7.2-fpm-alpine
22

33
# Install dependencies
4-
RUN apk add --no-cache php7-session php7-mysqli php7-mbstring php7-xml php7-gd php7-zlib php7-bz2 php7-zip php7-openssl php7-curl php7-opcache php7-json nginx php7-fpm supervisor
4+
RUN apk add --no-cache --virtual .build-deps \
5+
bzip2-dev \
6+
freetype-dev \
7+
libjpeg-turbo-dev \
8+
libpng-dev \
9+
libwebp-dev \
10+
libxpm-dev \
11+
; \
12+
\
13+
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; \
14+
docker-php-ext-install bz2 gd mysqli opcache zip; \
15+
\
16+
runDeps="$( \
17+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
18+
| tr ',' '\n' \
19+
| sort -u \
20+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
21+
)"; \
22+
apk add --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
23+
apk del .build-deps; \
24+
apk add --no-cache nginx supervisor
525

626
# Include keyring to verify download
727
COPY phpmyadmin.keyring /
@@ -20,22 +40,22 @@ LABEL version=$VERSION
2040

2141
# Download tarball, verify it using gpg and extract
2242
RUN set -x \
23-
&& GNUPGHOME="$(mktemp -d)" \
24-
&& export GNUPGHOME \
25-
&& apk add --no-cache curl gnupg \
26-
&& curl --output phpMyAdmin.tar.gz --location $URL \
27-
&& curl --output phpMyAdmin.tar.gz.asc --location $URL.asc \
28-
&& gpgv --keyring /phpmyadmin.keyring phpMyAdmin.tar.gz.asc phpMyAdmin.tar.gz \
29-
&& apk del --no-cache curl gnupg \
30-
&& rm -rf "$GNUPGHOME" \
31-
&& tar xzf phpMyAdmin.tar.gz \
32-
&& rm -f phpMyAdmin.tar.gz phpMyAdmin.tar.gz.asc \
33-
&& mv phpMyAdmin-$VERSION-all-languages /www \
34-
&& rm -rf /www/setup/ /www/examples/ /www/test/ /www/po/ /www/composer.json /www/RELEASE-DATE-$VERSION \
35-
&& sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php \
36-
&& chown -R root:nobody /www \
37-
&& find /www -type d -exec chmod 750 {} \; \
38-
&& find /www -type f -exec chmod 640 {} \;
43+
&& GNUPGHOME="$(mktemp -d)" \
44+
&& export GNUPGHOME \
45+
&& apk add --no-cache curl gnupg \
46+
&& curl --output phpMyAdmin.tar.gz --location $URL \
47+
&& curl --output phpMyAdmin.tar.gz.asc --location $URL.asc \
48+
&& gpgv --keyring /phpmyadmin.keyring phpMyAdmin.tar.gz.asc phpMyAdmin.tar.gz \
49+
&& apk del --no-cache curl gnupg \
50+
&& rm -rf "$GNUPGHOME" \
51+
&& tar xzf phpMyAdmin.tar.gz \
52+
&& rm -f phpMyAdmin.tar.gz phpMyAdmin.tar.gz.asc \
53+
&& mv phpMyAdmin-$VERSION-all-languages /www \
54+
&& rm -rf /www/setup/ /www/examples/ /www/test/ /www/po/ /www/composer.json /www/RELEASE-DATE-$VERSION \
55+
&& sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php \
56+
&& chown -R root:nobody /www \
57+
&& find /www -type d -exec chmod 750 {} \; \
58+
&& find /www -type f -exec chmod 640 {} \;
3959

4060
# Add directory for sessions to allow session persistence
4161
RUN mkdir /sessions

etc/supervisor.d/php.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[program:php-fpm]
2-
command=php-fpm7 --nodaemonize --fpm-config /etc/php-fpm.conf -c /etc/php.ini
2+
command=php-fpm --nodaemonize --fpm-config /etc/php-fpm.conf -c /etc/php.ini
33
user=nobody
44
autostart=true
55
autorestart=true

testing/phpmyadmin_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def test_content(match, content):
1515

1616
def test_phpmyadmin(url, username, password, server=None, sqlfile=None):
1717
if sqlfile is None:
18-
if os.path.exists('./world.sql'):
19-
sqlfile = './world.sql'
18+
if os.path.exists('/world.sql'):
19+
sqlfile = '/world.sql'
2020
else:
2121
sqlfile = './testing/world.sql'
2222
br = mechanize.Browser()

testing/test-docker.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ done
6969

7070
# Perform tests
7171
if [ $ret -eq 0 ] ; then
72-
if [ -f ./phpmyadmin_test.py ] ; then
72+
if [ -f /phpmyadmin_test.py ] ; then
73+
FILENAME=/phpmyadmin_test.py
74+
elif [ -f ./phpmyadmin_test.py ] ; then
7375
FILENAME=./phpmyadmin_test.py
7476
else
7577
FILENAME=./testing/phpmyadmin_test.py

0 commit comments

Comments
 (0)