Commit 9106c081 authored by Ernesto Rodriguez Ortiz's avatar Ernesto Rodriguez Ortiz
Browse files

docker: Using phusion/baseimage instead ubuntu like base image

Read about reasons in
parent 291f70ed
......@@ -2,18 +2,25 @@
FROM ubuntu:trusty
FROM phusion/baseimage
MAINTAINER Ernesto Rodriguez Ortiz <>
# Set correct environment variables.
ENV HOME /root
# Regenerate SSH host keys. baseimage-docker does not contain any, so you
# have to do that yourself. You may also comment out this instruction; the
# init system will auto-generate one during boot.
RUN /etc/my_init.d/
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Update software source
RUN apt-get update
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
# Install Apache, MySQL, PHP, and others..
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install vim curl wget git mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php-apc php5-gd php5-curl php5-memcache memcached mc php-pear postfix php5-imagick php5-dev build-essential
RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean
# Install drush, phpmd, phpcpd, site_audit, uploadprogress
RUN pear channel-discover && pear install drush/drush
......@@ -27,7 +34,20 @@ RUN ln -s /etc/php5/mods-available/uploadprogress.ini /etc/php5/apache2/conf.d/2
# Make mysql listen on the outside
RUN sed -i "s/^bind-address/#bind-address/" /etc/mysql/my.cnf
COPY start-servers /usr/local/bin/
WORKDIR /var/www/html
# Adding additional memcached daemon
RUN mkdir /etc/service/memcached
ADD service/ /etc/service/memcached/run
# Adding additional mysqld daemon
RUN mkdir /etc/service/apache2
ADD service/ /etc/service/apache2/run
# Adding additional apache2 daemon
RUN mkdir /etc/service/mysqld
ADD service/ /etc/service/mysqld/run
# Expose port 80 for apache connection on the aoutside
CMD ["start-servers"]
# Clean up APT when done.
RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
set -e
# Start nysql server
/usr/bin/mysqld_safe &
# Apache gets grumpy about PID files pre-existing
rm -f /var/run/apache2/
source /etc/apache2/envvars
exec /sbin/setuser memcache /usr/bin/memcached
exec /sbin/setuser mysql /usr/bin/mysqld_safe
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment