Installing CPhalcon on an AWS Docker image

I have a docker image that installs phalcon onto a Docker image. Here is the Dockerfile:

FROM ubuntu:trusty
MAINTAINER Fernando Mayo <>, Feng Honglin <>

# Install packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
  sudo apt-get -y install supervisor php5-dev libpcre3-dev gcc make php5-mysql git curl unzip apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc php5-mcrypt php5-curl && \
  echo "ServerName localhost" >> /etc/apache2/apache2.conf

# Add image configuration and scripts
RUN chmod 755 /*.sh
ADD my.cnf /etc/mysql/conf.d/my.cnf
ADD supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
ADD supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
ADD php.ini /etc/php5/cli/php.ini
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf

ADD 30-phalcon.ini /etc/php5/apache2/conf.d/30-phalcon.ini
ADD 30-phalcon.ini /etc/php5/cli/conf.d/30-phalcon.ini

#RUN rm -rd /var/www/html/*
#RUN git clone --depth=1 git:// /var/www/html/cphalcon
#RUN chmod 755 /var/www/html/cphalcon/build/install

RUN git clone --depth=1 git:// /usr/local/src/cphalcon
RUN cd /usr/local/src/cphalcon/build && ./install ;\
    echo "" > /etc/php5/mods-available/phalcon.ini ;\
    php5enmod phalcon

RUN sudo service apache2 stop
RUN sudo service apache2 start

# Remove pre-installed database
RUN rm -rf /var/lib/mysql/*

# Add MySQL utils
RUN chmod 755 /*.sh

# config to enable .htaccess
RUN a2enmod rewrite

# Copy over private key, and set permissions
ADD .ssh /root/.ssh

# Get aws stuff
RUN curl "" -o ""
RUN unzip
RUN ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

RUN rm -rd /var/www/html/*
RUN git clone ssh:// /var/www/html

#Environment variables to configure php

# Add volumes for MySQL 
VOLUME  ["/etc/mysql", "/var/lib/mysql" ]

EXPOSE 80 3306
CMD ["/"]

When I run this Docker image locally it works fine, but when I run it on Elastic Beanstalk I get the error: PHP Fatal error: Class ‘Phalcon\Loader’ not found. To debug this I checked phpinfo() both locally and on the AWS server. Locally it shows all of the phalcon files installed, but on AWS I don’t get any info about CPhalcon. How could the Docker image install Phalcon correctly when running on my local machine but not on Elastic Beanstalk?

  • How to view Chrome settings on XVFB?
  • Docker tomcat edit expanded war files
  • Docker - Unable to use placeholders inside ENTRYPOINT
  • angular-cli ng command not found even if it is installed while docker building an image
  • How to access private Docker Hub repository from Kubernetes on Vagrant
  • docker executable file not found in $PATH
  • Docker Swarm - Network Overlay not connecting all containers
  • Building docker image with angular 2, jupyter and typescript
  • Passing envs into gradle build?
  • Grails watch files doesn't work inside Docker container running inside a Vagrant virtual machine
  • Proftpd directory listing error on Docker container
  • How could I connect to nginx vhost in Docker container from linked php Docker container?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.