FROM ubuntu:14.04
ENV PHPVER 5.4.45
# To run this docker container:
# docker run -v $PWD:/p4php-dev <container_name>
# This Dockerfile assumes that the p4-php source code, and any dependencies,
# Will be mounted in /p4php-dev in the following directories
# //depot/main/p4-php -> p4php
# //3rd_party/cpp_libraries/openssl -> openssl
# //depot/main/p4 -> main/p4
# //depot/main/p4-bin/lib.linux26x86_64 -> main/p4-bin/lib.linux26x86_64
# //builds/main/p4-bin/bin.linux26x86_64/p4api.tgz -> p4api
# Create source directories for building php and p4php
RUN mkdir /p4php-dev /php /php-src
# Install necessary packages
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
pkg-config \
wget
# Copy build scripts
COPY php-get.sh /tmp/php-get.sh
COPY build-php.sh /tmp/build-php.sh
# Build PHP
RUN /tmp/php-get.sh $PHPVER
RUN /tmp/build-php.sh $PHPVER
# Add PHP to the path
ENV PATH /php/bin:$PATH
WORKDIR /p4php-dev
# Everything else should be mounted in /p4php-dev, so just run it:
CMD ["/p4php-dev/build-p4php.sh"]