Skip to content

Add alpine fpm variant #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ services: docker
env:
- VERSION=8.3-rc VARIANT=apache
- VERSION=8.3-rc VARIANT=fpm
- VERSION=8.3-rc VARIANT=fpm-alpine
- VERSION=8.2 VARIANT=apache
- VERSION=8.2 VARIANT=fpm
- VERSION=8.2 VARIANT=fpm-alpine
- VERSION=7 VARIANT=apache
- VERSION=7 VARIANT=fpm
- VERSION=7 VARIANT=fpm-alpine

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

before_script:
- env | sort
- cd "$VERSION/$VARIANT"
- image="drupal:$VERSION-$VARIANT"
- slash='/'; image="drupal:$VERSION-${VARIANT//$slash/-}"

script:
- travis_retry docker build -t "$image" .
Expand Down
21 changes: 17 additions & 4 deletions 7/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ FROM php:7.0-apache
RUN a2enmod rewrite

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql zip
RUN set -ex \
&& buildDeps=' \
libjpeg62-turbo-dev \
libpng12-dev \
libpq-dev \
' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
&& docker-php-ext-install -j "$(nproc)" gd mbstring pdo pdo_mysql pdo_pgsql zip \
# 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
# 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
&& apt-mark manual \
libjpeg62-turbo \
libpq5 \
&& apt-get purge -y --auto-remove $buildDeps

WORKDIR /var/www/html

Expand Down
39 changes: 39 additions & 0 deletions 7/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# from https://www.drupal.org/requirements/php#drupalversions
FROM php:7.0-fpm-alpine

# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
postgresql-dev \
&& docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
&& docker-php-ext-install -j "$(nproc)" gd mbstring pdo pdo_mysql pdo_pgsql zip \
&& runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .drupal-phpexts-rundeps $runDeps \
&& apk del .build-deps

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 7.54
ENV DRUPAL_MD5 3068cbe488075ae166e23ea6cd29cf0f

RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
&& tar -xz --strip-components=1 -f drupal.tar.gz \
&& rm drupal.tar.gz \
&& chown -R www-data:www-data sites
21 changes: 17 additions & 4 deletions 7/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@
FROM php:7.0-fpm

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql zip
RUN set -ex \
&& buildDeps=' \
libjpeg62-turbo-dev \
libpng12-dev \
libpq-dev \
' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
&& docker-php-ext-install -j "$(nproc)" gd mbstring pdo pdo_mysql pdo_pgsql zip \
# 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
# 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
&& apt-mark manual \
libjpeg62-turbo \
libpq5 \
&& apt-get purge -y --auto-remove $buildDeps

WORKDIR /var/www/html

Expand Down
21 changes: 17 additions & 4 deletions 8.2/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ FROM php:7.0-apache
RUN a2enmod rewrite

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
RUN set -ex \
&& buildDeps=' \
libjpeg62-turbo-dev \
libpng12-dev \
libpq-dev \
' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
# 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
# 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
&& apt-mark manual \
libjpeg62-turbo \
libpq5 \
&& apt-get purge -y --auto-remove $buildDeps

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down
50 changes: 50 additions & 0 deletions 8.2/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# from https://www.drupal.org/requirements/php#drupalversions
FROM php:7.0-fpm-alpine

# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
postgresql-dev \
&& docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
&& runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .drupal-phpexts-rundeps $runDeps \
&& apk del .build-deps

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.2.6
ENV DRUPAL_MD5 57526a827771ea8a06db1792f1602a85

RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
&& tar -xz --strip-components=1 -f drupal.tar.gz \
&& rm drupal.tar.gz \
&& chown -R www-data:www-data sites modules themes
21 changes: 17 additions & 4 deletions 8.2/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@
FROM php:7.0-fpm

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
RUN set -ex \
&& buildDeps=' \
libjpeg62-turbo-dev \
libpng12-dev \
libpq-dev \
' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
# 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
# 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
&& apt-mark manual \
libjpeg62-turbo \
libpq5 \
&& apt-get purge -y --auto-remove $buildDeps

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down
21 changes: 17 additions & 4 deletions 8.3-rc/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ FROM php:7.1-apache
RUN a2enmod rewrite

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
RUN set -ex \
&& buildDeps=' \
libjpeg62-turbo-dev \
libpng12-dev \
libpq-dev \
' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
# 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
# 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
&& apt-mark manual \
libjpeg62-turbo \
libpq5 \
&& apt-get purge -y --auto-remove $buildDeps

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down
50 changes: 50 additions & 0 deletions 8.3-rc/fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# from https://www.drupal.org/requirements/php#drupalversions
FROM php:7.0-fpm-alpine

# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
postgresql-dev \
&& docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
&& runDeps="$( \
scanelf --needed --nobanner --recursive \
/usr/local/lib/php/extensions \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .drupal-phpexts-rundeps $runDeps \
&& apk del .build-deps

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.3.0-rc1
ENV DRUPAL_MD5 0acd6c49d5626cd47077eb2650a409cb

RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \
&& tar -xz --strip-components=1 -f drupal.tar.gz \
&& rm drupal.tar.gz \
&& chown -R www-data:www-data sites modules themes
21 changes: 17 additions & 4 deletions 8.3-rc/fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,23 @@
FROM php:7.1-fpm

# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring opcache pdo pdo_mysql pdo_pgsql zip
RUN set -ex \
&& buildDeps=' \
libjpeg62-turbo-dev \
libpng12-dev \
libpq-dev \
' \
&& apt-get update && apt-get install -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
&& docker-php-ext-install -j "$(nproc)" gd mbstring opcache pdo pdo_mysql pdo_pgsql zip \
# 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
# 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
&& apt-mark manual \
libjpeg62-turbo \
libpq5 \
&& apt-get purge -y --auto-remove $buildDeps

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
Expand Down
2 changes: 1 addition & 1 deletion generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ join() {

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

fullVersion="$(git show "$commit":"$version/$variant/Dockerfile" | awk '$1 == "ENV" && $2 == "DRUPAL_VERSION" { print $3; exit }')"
Expand Down
6 changes: 3 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ for version in "${versions[@]}"; do
exit 1
fi
md5="$(grep -A6 -m1 '>drupal-'"$fullVersion"'.tar.gz<' release | grep -A1 -m1 '"md5 hash"' | tail -1 | awk '{ print $1 }')"

(
set -x
sed -ri '
s/^(ENV DRUPAL_VERSION) .*/\1 '"$fullVersion"'/;
s/^(ENV DRUPAL_MD5) .*/\1 '"$md5"'/;
' "$version"/*/Dockerfile
)
for variant in fpm apache; do

for variant in fpm-alpine fpm apache; do
travisEnv='\n - VERSION='"$version"' VARIANT='"$variant$travisEnv"
done
done
Expand Down