Closed bishopb closed 9 years ago
You'll need to create your own docker image to use. I'd recommend using the PHP 5.4 as a template.
custom-image
(or whatever you want to call it).Dockerfile
that I linked above into this folder.Dockerfile
. On line 2 change FROM vectorface/php-base
to FROM vectorface/php5.4
. On line 3 add additional debian packages you want (php5-mysql, etc).docker build -t custom-image
(replace the folder name). When it's done you'll have your own image called custom-image
..dunitconfig
to use your own image instead of the defaults. Or you can use ./vendor/bin/dunit -i custom-image
.Thanks, that did it nicely! The resulting Dockerfile:
# builds a Debian wheezy image with PHP 5.4
FROM vectorface/php5.4
ENV DUNIT_INSTALL_PACKAGES php5-cli php-apc php5-curl php5-gd php5-intl php5-json php5-mcrypt
ENV LOCAL_INSTALL_PACKAGES php5-imap php5-ldap php5-mysql
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN \
apt-get -y update && \
apt-get -y install $DUNIT_INSTALL_PACKAGES $LOCAL_INSTALL_PACKAGES && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
Dockerfile for PHP 5.5 on Debian Wheezy with additional modules:
# Creates a Debian wheezy image with PHP 5.5
# docker build -t my-image path/to/my-image/
FROM vectorface/php5.5
ENV DUNIT_INSTALL_PACKAGES php5-cli php5-apcu php5-curl php5-gd php5-intl php5-json php5-mcrypt
ENV LOCAL_INSTALL_PACKAGES php5-imap php5-ldap php5-mysql
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN \
apt-get update && \
apt-get -y update && \
apt-get install -y curl
RUN \
echo 'deb http://packages.dotdeb.org wheezy all' >> /etc/apt/sources.list && \
echo 'deb-src http://packages.dotdeb.org wheezy all' >> /etc/apt/sources.list && \
echo 'deb http://packages.dotdeb.org wheezy-php55 all' >> /etc/apt/sources.list && \
echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' >> /etc/apt/sources.list && \
curl -O http://www.dotdeb.org/dotdeb.gpg && \
apt-key add dotdeb.gpg
RUN \
apt-get -y update && \
apt-get -y install $DUNIT_INSTALL_PACKAGES $LOCAL_INSTALL_PACKAGES && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
To do the same for 5.6, search & replace:
I've noticed that the Dockerfile for 5.4 (and probably others) accepts a build parameter of
$PHP_EXTRA_BUILD_DEPS
.How can I tweak and pass this variable into the Dockerfile when pulling the images through dUnit?
For example, something along the lines of:
PHP_EXTRA_BUILD_DEPS='pdo pdo_mysql' ./vendor/bin/dunit -i -p