Skip to content

Add FPM variants (styled after OwnCloud's script updates for this same thing) #32

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 1 commit into from
Feb 12, 2016
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
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ language: bash
services: docker

env:
- VERSION=8
- VERSION=7
- VERSION=8 VARIANT=apache
- VERSION=8 VARIANT=fpm
- VERSION=7 VARIANT=apache
- VERSION=7 VARIANT=fpm

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

before_script:
- env | sort
- cd "$VERSION"
- image="drupal:$VERSION"
- cd "$VERSION/$VARIANT"
- image="drupal:$VERSION-$VARIANT"

script:
- docker build -t "$image" .
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions 7/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# from https://www.drupal.org/requirements/php#drupalversions
FROM php:5.6-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

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 7.42
ENV DRUPAL_MD5 9a96f67474e209dd48750ba6fccc77db

RUN curl -fSL "http://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
File renamed without changes.
31 changes: 31 additions & 0 deletions 8/fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# from https://www.drupal.org/requirements/php#drupalversions
FROM php:5.6-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

# 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.0.3
ENV DRUPAL_MD5 7d5f5278a870b8f4a29cda4fe915d619

RUN curl -fSL "http://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
35 changes: 22 additions & 13 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,27 @@ url='git://github.com/docker-library/drupal'
echo '# maintainer: InfoSiftr <[email protected]> (@infosiftr)'

for version in "${versions[@]}"; do
commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
fullVersion="$(grep -m1 'ENV DRUPAL_VERSION' "$version/Dockerfile" | cut -d' ' -f3)"

versionAliases=()
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=( $version ${aliases[$version]} )

echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
for variant in apache fpm; do
commit="$(cd "$version/$variant" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
fullVersion="$(grep -m1 'ENV DRUPAL_VERSION ' "$version/$variant/Dockerfile" | cut -d' ' -f3)"

versionAliases=()
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
versionAliases+=( $fullVersion )
fullVersion="${fullVersion%[.-]*}"
done
versionAliases+=( $version ${aliases[$version]} )

echo
for va in "${versionAliases[@]}"; do
if [ "$va" = 'latest' ]; then
echo "$variant: ${url}@${commit} $version/$variant"
else
echo "$va-$variant: ${url}@${commit} $version/$variant"
fi
if [ "$variant" = 'apache' ]; then
echo "$va: ${url}@${commit} $version/$variant"
fi
done
done
done
6 changes: 4 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ for version in "${versions[@]}"; do
sed -ri '
s/^(ENV DRUPAL_VERSION) .*/\1 '"$fullVersion"'/;
s/^(ENV DRUPAL_MD5) .*/\1 '"$md5"'/;
' "$version/Dockerfile"
' "$version"/*/Dockerfile
)

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

travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
Expand Down