Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nootanghimire/4334144e67ea0e10586481f9e1738ceb to your computer and use it in GitHub Desktop.
Save nootanghimire/4334144e67ea0e10586481f9e1738ceb to your computer and use it in GitHub Desktop.
FROM ubuntu:12.04
MAINTAINER nootan.ghimire@gmail.com
# Add Repo for PHP 5.4 Support
RUN echo "deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu precise main " > /etc/apt/sources.list.d/ondrej.list && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C
# Install php-5.4 and build essentials
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -qqy install \
openssl ca-certificates curl postfix \
php5 php5-dev php5-mysql php5-gd php-pear php-apc \
gcc git make
# Compile phalcon-v1.3.4 and add ".so" to ini file
RUN mkdir -p /opt/ext-phalcon-git && \
git clone --depth=1 --branch 1.3.4 git://github.com/phalcon/cphalcon.git /opt/ext-phalcon-git && \
cd /opt/ext-phalcon-git/build
# GCC 4.6 with newer system fail to compile phalcon when using
# -march=native CFLAG, which is default in the repo's install script
# Remove that with some sed magic
RUN cd /opt/ext-phalcon-git/build && \
sed -i '/-march=native /{ s/-march=native//g }' install && \
export CFLAGS="-O2 -finline-functions -fvisibility=hidden" && ./install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment