Skip to content
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

Keep the source and instead just "make clean" #41

Merged
merged 2 commits into from
Nov 12, 2014
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
26 changes: 15 additions & 11 deletions 5.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*

# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*

ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d

##<autogenerated>##
##</autogenerated>##

RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA04B5D

ENV PHP_VERSION 5.4.34

# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
Expand All @@ -32,22 +35,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean

COPY docker-php-ext-* /usr/local/bin/

##<autogenerated>##
CMD ["php", "-a"]
Expand Down
26 changes: 15 additions & 11 deletions 5.4/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*

# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*

ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d

##<autogenerated>##
RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*

Expand All @@ -23,18 +29,15 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys F38252826ACD957EF380D39F2F7956BC5DA0

ENV PHP_VERSION 5.4.34

# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
Expand All @@ -45,22 +48,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean

COPY docker-php-ext-* /usr/local/bin/

##<autogenerated>##
WORKDIR /var/www/html
Expand Down
19 changes: 19 additions & 0 deletions 5.4/apache/docker-php-ext-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift

set -x
cd "$extDir"
phpize
./configure "$@"
55 changes: 55 additions & 0 deletions 5.4/apache/docker-php-ext-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
set -e

cd /usr/src/php/ext

usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}

exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done

if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi

for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done
19 changes: 19 additions & 0 deletions 5.4/docker-php-ext-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

ext="$1"
extDir="/usr/src/php/ext/$ext"
if [ -z "$ext" -o ! -d "$extDir" ]; then
echo >&2 "usage: $0 ext-name [configure flags]"
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo >&2
echo >&2 'Possible values for ext-name:'
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
exit 1
fi
shift

set -x
cd "$extDir"
phpize
./configure "$@"
55 changes: 55 additions & 0 deletions 5.4/docker-php-ext-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
set -e

cd /usr/src/php/ext

usage() {
echo "usage: $0 ext-name [ext-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
echo
echo 'Possible values for ext-name:'
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
}

exts=()
while [ $# -gt 0 ]; do
ext="$1"
shift
if [ -z "$ext" ]; then
continue
fi
if [ ! -d "$ext" ]; then
echo >&2 "error: $(pwd -P)/$ext does not exist"
echo >&2
usage >&2
exit 1
fi
exts+=( "$ext" )
done

if [ "${#exts[@]}" -eq 0 ]; then
usage >&2
exit 1
fi

for ext in "${exts[@]}"; do
(
cd "$ext"
[ -e Makefile ] || docker-php-ext-configure "$ext"
make
make install
ini="/usr/local/etc/php/conf.d/docker-php-ext-$ext.ini"
for module in modules/*.so; do
if [ -f "$module" ]; then
line="extension=$(basename "$module")"
if ! grep -q "$line" "$ini"; then
echo "$line" >> "/usr/local/etc/php/conf.d/ext-$ext.ini"
fi
fi
done
make clean
)
done
26 changes: 15 additions & 11 deletions 5.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ FROM debian:jessie
# persistent / runtime deps
RUN apt-get update && apt-get install -y ca-certificates curl libxml2 --no-install-recommends && rm -r /var/lib/apt/lists/*

# phpize deps
RUN apt-get update && apt-get install -y autoconf gcc pkg-config --no-install-recommends && rm -r /var/lib/apt/lists/*

ENV PHP_INI_DIR /usr/local/etc/php
RUN mkdir -p $PHP_INI_DIR/conf.d

##<autogenerated>##
##</autogenerated>##

RUN gpg --keyserver pgp.mit.edu --recv-keys 0BD78B5F97500D450838F95DFE857D9A90D90EC1 0B96609E270F565C13292B24C13C70B87267B52D

ENV PHP_VERSION 5.5.18

# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself)
RUN buildDeps=" \
$PHP_EXTRA_BUILD_DEPS \
build-essential \
bzip2 \
file \
libcurl4-openssl-dev \
libpng12-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
m4 \
pkg-config \
"; \
set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
Expand All @@ -32,22 +35,23 @@ RUN buildDeps=" \
&& tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1 \
&& rm php.tar.bz2* \
&& cd /usr/src/php \
&& ./configure --disable-cgi \
&& ./configure \
--with-config-file-path="$PHP_INI_DIR" \
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
$PHP_EXTRA_CONFIGURE_ARGS \
--enable-soap \
--disable-cgi \
--enable-mysqlnd \
--with-curl \
--with-gd \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-readline \
--with-zlib \
&& make -j"$(nproc)" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -r /usr/src/php
&& make clean

COPY docker-php-ext-* /usr/local/bin/

##<autogenerated>##
CMD ["php", "-a"]
Expand Down
Loading