Skip to content

Commit 74de2d0

Browse files
authored
Merge pull request #72 from sylus/master
Add alpine fpm variant
2 parents 959a9c6 + e8e2309 commit 74de2d0

File tree

12 files changed

+249
-29
lines changed

12 files changed

+249
-29
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ services: docker
44
env:
55
- VERSION=8.3-rc VARIANT=apache
66
- VERSION=8.3-rc VARIANT=fpm
7+
- VERSION=8.3-rc VARIANT=fpm-alpine
78
- VERSION=8.2 VARIANT=apache
89
- VERSION=8.2 VARIANT=fpm
10+
- VERSION=8.2 VARIANT=fpm-alpine
911
- VERSION=7 VARIANT=apache
1012
- VERSION=7 VARIANT=fpm
13+
- VERSION=7 VARIANT=fpm-alpine
1114

1215
install:
1316
- git clone https://github.com/docker-library/official-images.git ~/official-images
1417

1518
before_script:
1619
- env | sort
1720
- cd "$VERSION/$VARIANT"
18-
- image="drupal:$VERSION-$VARIANT"
21+
- slash='/'; image="drupal:$VERSION-${VARIANT//$slash/-}"
1922

2023
script:
2124
- travis_retry docker build -t "$image" .

7/apache/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@ FROM php:7.0-apache
44
RUN a2enmod rewrite
55

66
# install the PHP extensions we need
7-
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
8-
&& rm -rf /var/lib/apt/lists/* \
9-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
10-
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql zip
7+
RUN set -ex \
8+
&& buildDeps=' \
9+
libjpeg62-turbo-dev \
10+
libpng12-dev \
11+
libpq-dev \
12+
' \
13+
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
14+
&& docker-php-ext-configure gd \
15+
--with-jpeg-dir=/usr \
16+
--with-png-dir=/usr \
17+
&& docker-php-ext-install -j "$(nproc)" gd mbstring pdo pdo_mysql pdo_pgsql zip \
18+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
19+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so' - libpq.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
20+
&& apt-mark manual \
21+
libjpeg62-turbo \
22+
libpq5 \
23+
&& apt-get purge -y --auto-remove $buildDeps
1124

1225
WORKDIR /var/www/html
1326

7/fpm-alpine/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# from https://www.drupal.org/requirements/php#drupalversions
2+
FROM php:7.0-fpm-alpine
3+
4+
# install the PHP extensions we need
5+
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
6+
RUN set -ex \
7+
&& apk add --no-cache --virtual .build-deps \
8+
coreutils \
9+
freetype-dev \
10+
libjpeg-turbo-dev \
11+
libpng-dev \
12+
postgresql-dev \
13+
&& docker-php-ext-configure gd \
14+
--with-freetype-dir=/usr/include/ \
15+
--with-jpeg-dir=/usr/include/ \
16+
--with-png-dir=/usr/include/ \
17+
&& docker-php-ext-install -j "$(nproc)" gd mbstring pdo pdo_mysql pdo_pgsql zip \
18+
&& runDeps="$( \
19+
scanelf --needed --nobanner --recursive \
20+
/usr/local/lib/php/extensions \
21+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
22+
| sort -u \
23+
| xargs -r apk info --installed \
24+
| sort -u \
25+
)" \
26+
&& apk add --virtual .drupal-phpexts-rundeps $runDeps \
27+
&& apk del .build-deps
28+
29+
WORKDIR /var/www/html
30+
31+
# https://www.drupal.org/node/3060/release
32+
ENV DRUPAL_VERSION 7.54
33+
ENV DRUPAL_MD5 3068cbe488075ae166e23ea6cd29cf0f
34+
35+
RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
36+
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
37+
&& tar -xz --strip-components=1 -f drupal.tar.gz \
38+
&& rm drupal.tar.gz \
39+
&& chown -R www-data:www-data sites

7/fpm/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22
FROM php:7.0-fpm
33

44
# install the PHP extensions we need
5-
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
6-
&& rm -rf /var/lib/apt/lists/* \
7-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
8-
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql zip
5+
RUN set -ex \
6+
&& buildDeps=' \
7+
libjpeg62-turbo-dev \
8+
libpng12-dev \
9+
libpq-dev \
10+
' \
11+
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
12+
&& docker-php-ext-configure gd \
13+
--with-jpeg-dir=/usr \
14+
--with-png-dir=/usr \
15+
&& docker-php-ext-install -j "$(nproc)" gd mbstring pdo pdo_mysql pdo_pgsql zip \
16+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
17+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so' - libpq.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
18+
&& apt-mark manual \
19+
libjpeg62-turbo \
20+
libpq5 \
21+
&& apt-get purge -y --auto-remove $buildDeps
922

1023
WORKDIR /var/www/html
1124

8.2/apache/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@ FROM php:7.0-apache
44
RUN a2enmod rewrite
55

66
# install the PHP extensions we need
7-
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
8-
&& rm -rf /var/lib/apt/lists/* \
9-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
10-
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
7+
RUN set -ex \
8+
&& buildDeps=' \
9+
libjpeg62-turbo-dev \
10+
libpng12-dev \
11+
libpq-dev \
12+
' \
13+
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
14+
&& docker-php-ext-configure gd \
15+
--with-jpeg-dir=/usr \
16+
--with-png-dir=/usr \
17+
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
18+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
19+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so' - libpq.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
20+
&& apt-mark manual \
21+
libjpeg62-turbo \
22+
libpq5 \
23+
&& apt-get purge -y --auto-remove $buildDeps
1124

1225
# set recommended PHP.ini settings
1326
# see https://secure.php.net/manual/en/opcache.installation.php

8.2/fpm-alpine/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# from https://www.drupal.org/requirements/php#drupalversions
2+
FROM php:7.0-fpm-alpine
3+
4+
# install the PHP extensions we need
5+
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
6+
RUN set -ex \
7+
&& apk add --no-cache --virtual .build-deps \
8+
coreutils \
9+
freetype-dev \
10+
libjpeg-turbo-dev \
11+
libpng-dev \
12+
postgresql-dev \
13+
&& docker-php-ext-configure gd \
14+
--with-freetype-dir=/usr/include/ \
15+
--with-jpeg-dir=/usr/include/ \
16+
--with-png-dir=/usr/include/ \
17+
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
18+
&& runDeps="$( \
19+
scanelf --needed --nobanner --recursive \
20+
/usr/local/lib/php/extensions \
21+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
22+
| sort -u \
23+
| xargs -r apk info --installed \
24+
| sort -u \
25+
)" \
26+
&& apk add --virtual .drupal-phpexts-rundeps $runDeps \
27+
&& apk del .build-deps
28+
29+
# set recommended PHP.ini settings
30+
# see https://secure.php.net/manual/en/opcache.installation.php
31+
RUN { \
32+
echo 'opcache.memory_consumption=128'; \
33+
echo 'opcache.interned_strings_buffer=8'; \
34+
echo 'opcache.max_accelerated_files=4000'; \
35+
echo 'opcache.revalidate_freq=60'; \
36+
echo 'opcache.fast_shutdown=1'; \
37+
echo 'opcache.enable_cli=1'; \
38+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
39+
40+
WORKDIR /var/www/html
41+
42+
# https://www.drupal.org/node/3060/release
43+
ENV DRUPAL_VERSION 8.2.6
44+
ENV DRUPAL_MD5 57526a827771ea8a06db1792f1602a85
45+
46+
RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
47+
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
48+
&& tar -xz --strip-components=1 -f drupal.tar.gz \
49+
&& rm drupal.tar.gz \
50+
&& chown -R www-data:www-data sites modules themes

8.2/fpm/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22
FROM php:7.0-fpm
33

44
# install the PHP extensions we need
5-
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
6-
&& rm -rf /var/lib/apt/lists/* \
7-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
8-
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
5+
RUN set -ex \
6+
&& buildDeps=' \
7+
libjpeg62-turbo-dev \
8+
libpng12-dev \
9+
libpq-dev \
10+
' \
11+
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
12+
&& docker-php-ext-configure gd \
13+
--with-jpeg-dir=/usr \
14+
--with-png-dir=/usr \
15+
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
16+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
17+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so' - libpq.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
18+
&& apt-mark manual \
19+
libjpeg62-turbo \
20+
libpq5 \
21+
&& apt-get purge -y --auto-remove $buildDeps
922

1023
# set recommended PHP.ini settings
1124
# see https://secure.php.net/manual/en/opcache.installation.php

8.3-rc/apache/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@ FROM php:7.1-apache
44
RUN a2enmod rewrite
55

66
# install the PHP extensions we need
7-
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
8-
&& rm -rf /var/lib/apt/lists/* \
9-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
10-
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
7+
RUN set -ex \
8+
&& buildDeps=' \
9+
libjpeg62-turbo-dev \
10+
libpng12-dev \
11+
libpq-dev \
12+
' \
13+
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
14+
&& docker-php-ext-configure gd \
15+
--with-jpeg-dir=/usr \
16+
--with-png-dir=/usr \
17+
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
18+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
19+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so' - libpq.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
20+
&& apt-mark manual \
21+
libjpeg62-turbo \
22+
libpq5 \
23+
&& apt-get purge -y --auto-remove $buildDeps
1124

1225
# set recommended PHP.ini settings
1326
# see https://secure.php.net/manual/en/opcache.installation.php

8.3-rc/fpm-alpine/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# from https://www.drupal.org/requirements/php#drupalversions
2+
FROM php:7.0-fpm-alpine
3+
4+
# install the PHP extensions we need
5+
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
6+
RUN set -ex \
7+
&& apk add --no-cache --virtual .build-deps \
8+
coreutils \
9+
freetype-dev \
10+
libjpeg-turbo-dev \
11+
libpng-dev \
12+
postgresql-dev \
13+
&& docker-php-ext-configure gd \
14+
--with-freetype-dir=/usr/include/ \
15+
--with-jpeg-dir=/usr/include/ \
16+
--with-png-dir=/usr/include/ \
17+
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
18+
&& runDeps="$( \
19+
scanelf --needed --nobanner --recursive \
20+
/usr/local/lib/php/extensions \
21+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
22+
| sort -u \
23+
| xargs -r apk info --installed \
24+
| sort -u \
25+
)" \
26+
&& apk add --virtual .drupal-phpexts-rundeps $runDeps \
27+
&& apk del .build-deps
28+
29+
# set recommended PHP.ini settings
30+
# see https://secure.php.net/manual/en/opcache.installation.php
31+
RUN { \
32+
echo 'opcache.memory_consumption=128'; \
33+
echo 'opcache.interned_strings_buffer=8'; \
34+
echo 'opcache.max_accelerated_files=4000'; \
35+
echo 'opcache.revalidate_freq=60'; \
36+
echo 'opcache.fast_shutdown=1'; \
37+
echo 'opcache.enable_cli=1'; \
38+
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
39+
40+
WORKDIR /var/www/html
41+
42+
# https://www.drupal.org/node/3060/release
43+
ENV DRUPAL_VERSION 8.3.0-rc1
44+
ENV DRUPAL_MD5 0acd6c49d5626cd47077eb2650a409cb
45+
46+
RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
47+
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
48+
&& tar -xz --strip-components=1 -f drupal.tar.gz \
49+
&& rm drupal.tar.gz \
50+
&& chown -R www-data:www-data sites modules themes

8.3-rc/fpm/Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22
FROM php:7.1-fpm
33

44
# install the PHP extensions we need
5-
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
6-
&& rm -rf /var/lib/apt/lists/* \
7-
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
8-
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
5+
RUN set -ex \
6+
&& buildDeps=' \
7+
libjpeg62-turbo-dev \
8+
libpng12-dev \
9+
libpq-dev \
10+
' \
11+
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
12+
&& docker-php-ext-configure gd \
13+
--with-jpeg-dir=/usr \
14+
--with-png-dir=/usr \
15+
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
16+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0
17+
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/pdo_pgsql.so' - libpq.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
18+
&& apt-mark manual \
19+
libjpeg62-turbo \
20+
libpq5 \
21+
&& apt-get purge -y --auto-remove $buildDeps
922

1023
# set recommended PHP.ini settings
1124
# see https://secure.php.net/manual/en/opcache.installation.php

generate-stackbrew-library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ join() {
5454

5555
for version in "${versions[@]}"; do
5656
rcVersion="${version%-rc}"
57-
for variant in apache fpm; do
57+
for variant in apache fpm fpm-alpine; do
5858
commit="$(dirCommit "$version/$variant")"
5959

6060
fullVersion="$(git show "$commit":"$version/$variant/Dockerfile" | awk '$1 == "ENV" && $2 == "DRUPAL_VERSION" { print $3; exit }')"

update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ for version in "${versions[@]}"; do
3030
exit 1
3131
fi
3232
md5="$(grep -A6 -m1 '>drupal-'"$fullVersion"'.tar.gz<' release | grep -A1 -m1 '"md5 hash"' | tail -1 | awk '{ print $1 }')"
33-
33+
3434
(
3535
set -x
3636
sed -ri '
3737
s/^(ENV DRUPAL_VERSION) .*/\1 '"$fullVersion"'/;
3838
s/^(ENV DRUPAL_MD5) .*/\1 '"$md5"'/;
3939
' "$version"/*/Dockerfile
4040
)
41-
42-
for variant in fpm apache; do
41+
42+
for variant in fpm-alpine fpm apache; do
4343
travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv"
4444
done
4545
done

0 commit comments

Comments
 (0)